Skip to content

Commit

Permalink
Add a test that demonstrates the issue
Browse files Browse the repository at this point in the history
  • Loading branch information
theneva committed Dec 11, 2018
1 parent 0da1acd commit eebc494
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions e2e/__tests__/multi_project_runner.test.js
Expand Up @@ -253,6 +253,42 @@ test('allows a single project', () => {
expect(status).toEqual(0);
});

test.each([{projectPath: 'packages/somepackage'}, {projectPath: 'packages/*'}])(
'allows a single non-root project',
({projectPath}: {projectPath: string}) => {
writeFiles(DIR, {
'package.json': `
{
"jest": {
"testMatch": [],
"projects": [
"${projectPath}"
]
}
}
`,
'packages/somepackage/package.json': `
{
"jest": {
"displayName": "somepackage"
}
}
`,
'packages/somepackage/test.js': `
test('1+1', () => {
expect(1).toBe(1);
});
`,
});

const {stdout, stderr, status} = runJest(DIR, ['--no-watchman']);
expect(stderr).toContain('PASS somepackage packages/somepackage/test.js');
expect(stderr).toContain('Test Suites: 1 passed, 1 total');
expect(stdout).toEqual('');
expect(status).toEqual(0);
},
);

test('resolves projects and their <rootDir> properly', () => {
writeFiles(DIR, {
'.watchmanconfig': '',
Expand Down

0 comments on commit eebc494

Please sign in to comment.