diff --git a/e2e/__tests__/testMatchTs.test.ts b/e2e/__tests__/testMatchTs.test.ts new file mode 100644 index 000000000000..e6af02cc5cc7 --- /dev/null +++ b/e2e/__tests__/testMatchTs.test.ts @@ -0,0 +1,16 @@ +/** + * 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 {extractSummary} from '../Utils'; +import runJest from '../runJest'; + +it('testMatch should able to match file with cts and mts extension', () => { + const result = runJest('test-match-ts'); + expect(result.exitCode).toBe(0); + const {summary} = extractSummary(result.stderr); + expect(summary).toMatchSnapshot(); +}); diff --git a/e2e/test-match-ts/__tests__/sample-suite.mts b/e2e/test-match-ts/__tests__/sample-suite.mts new file mode 100644 index 000000000000..9c58cacc90ec --- /dev/null +++ b/e2e/test-match-ts/__tests__/sample-suite.mts @@ -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. + */ + +test('mts extension', () => { + expect(1).toBe(1); +}); diff --git a/e2e/test-match-ts/__tests__/sample-suite2.cts b/e2e/test-match-ts/__tests__/sample-suite2.cts new file mode 100644 index 000000000000..5a27bdb1cc01 --- /dev/null +++ b/e2e/test-match-ts/__tests__/sample-suite2.cts @@ -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. + */ + +test('cts extension', () => { + expect(1).toBe(1); +}); diff --git a/e2e/test-match-ts/package.json b/e2e/test-match-ts/package.json new file mode 100644 index 000000000000..19272f0febb0 --- /dev/null +++ b/e2e/test-match-ts/package.json @@ -0,0 +1,7 @@ +{ + "jest": { + "testMatch": [ + "**/__tests__/*.?ts" + ] + } +}