Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions e2e/rootDir/fixtures/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { describe, expect, it } from '@rstest/core';

describe('Index', () => {
it('should add two numbers correctly', () => {
expect(1 + 1).toBe(2);
});
});
7 changes: 7 additions & 0 deletions e2e/rootDir/fixtures/index1.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { describe, expect, it } from '@rstest/core';

describe('Index1', () => {
it('should add two numbers correctly', () => {
expect(1 + 1).toBe(2);
});
});
6 changes: 6 additions & 0 deletions e2e/rootDir/fixtures/rstest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { defineConfig } from '@rstest/core';

export default defineConfig({
include: ['<rootDir>/**/*.test.ts'],
exclude: ['<rootDir>/index1.test.ts'],
});
29 changes: 29 additions & 0 deletions e2e/rootDir/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { describe, it } from '@rstest/core';
import { runRstestCli } from '../scripts/';

const __filename = fileURLToPath(import.meta.url);

const __dirname = dirname(__filename);

describe('test <rootDir>', () => {
it('should match files correctly with <rootDir>', async ({
onTestFinished,
}) => {
const { expectExecSuccess, expectLog } = await runRstestCli({
command: 'rstest',
args: ['run'],
onTestFinished,
options: {
nodeOptions: {
cwd: join(__dirname, 'fixtures'),
},
},
});

await expectExecSuccess();

expectLog('Test Files 1 passed');
});
});
Loading