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
Next Next commit
Add failing test for --testPathPatterns with subproject
  • Loading branch information
brandonchinn178 committed Mar 3, 2024
commit a3c4f46efce126be213aa1884b4553f7077b4538
17 changes: 17 additions & 0 deletions e2e/__tests__/testPathPatternsSubprojects.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import {json} from '../runJest';

it('works when specifying --testPathPatterns when config is in subdir', () => {
const {
json: {numTotalTests},
} = json('test-path-patterns-subprojects', [
'--config=config/jest.config.js',
'--testPathPatterns=testA',
]);
expect(numTotalTests).toBe(1);
});
10 changes: 10 additions & 0 deletions e2e/test-path-patterns-subprojects/config/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

module.exports = {
projects: [{rootDir: 'src'}],
};
1 change: 1 addition & 0 deletions e2e/test-path-patterns-subprojects/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
10 changes: 10 additions & 0 deletions e2e/test-path-patterns-subprojects/src/__tests__/testA.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

'use strict';

it('test', () => {});
10 changes: 10 additions & 0 deletions e2e/test-path-patterns-subprojects/src/__tests__/testB.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

'use strict';

it('test', () => {});
10 changes: 10 additions & 0 deletions e2e/test-path-patterns-subprojects/src/__tests__/testC.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

'use strict';

it('test', () => {});