Skip to content

Commit 250ca2a

Browse files
build: Use .cjs file extension with CJS jest configs (#19502)
Renames all the Jest config files to use the .cjs file extension. This will make it easier to add type: module to ESM-only packages. I used these commands to do the bulk of the work: ```shell fd --glob "**/jest*.config.js" --hidden --exec mv {} {.}.cjs fd --extension test.ts --exec sd --fixed-strings 'jest.config";' 'jest.config.cjs";' ``` --------- Co-authored-by: Daniel Lehenbauer <[email protected]>
1 parent 5223bbd commit 250ca2a

File tree

112 files changed

+34
-34
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+34
-34
lines changed

examples/apps/collaborative-textarea/tests/collaborativetext.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { globals } from "../jest.config";
6+
import { globals } from "../jest.config.cjs";
77
import { retryWithEventualValue } from "@fluidframework/test-utils";
88

99
describe("collaborativetext", () => {

examples/apps/contact-collection/tests/contactCollection.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { globals } from "../jest.config";
6+
import { globals } from "../jest.config.cjs";
77

88
// Tests disabled -- requires Tinylicious to be running, which our test environment doesn't do.
99
describe("contactCollection", () => {

examples/apps/data-object-grid/tests/dataObjectGrid.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { globals } from "../jest.config";
6+
import { globals } from "../jest.config.cjs";
77

88
describe("data-object-grid", () => {
99
beforeAll(async () => {

examples/apps/presence-tracker/tests/presenceTracker.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { globals } from "../jest.config";
6+
import { globals } from "../jest.config.cjs";
77

88
describe("presence-tracker", () => {
99
beforeAll(async () => {

examples/apps/task-selection/tests/diceRoller.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { globals } from "../jest.config";
6+
import { globals } from "../jest.config.cjs";
77

88
// Tests disabled -- requires Tinylicious to be running, which our test environment doesn't do.
99
describe("diceRoller", () => {

examples/apps/tree-comparison/tests/inventoryList.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { globals } from "../jest.config";
6+
import { globals } from "../jest.config.cjs";
77

88
// Tests disabled -- requires Tinylicious to be running, which our test environment doesn't do.
99
describe("inventoryList", () => {

examples/benchmarks/bubblebench/baseline/tests/demo.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { globals } from "../jest.config";
6+
import { globals } from "../jest.config.cjs";
77

88
describe("Bubblebench", () => {
99
describe("Baseline", () => {

examples/benchmarks/bubblebench/editable-shared-tree/tests/demo.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// If reporter configuration is deduplicated, then validation of it in every package can be removed, then support for TypeScript config files can be added,
1010
// then the config ported to TypeScript and expect-error can be removed.
1111
// @ts-expect-error This is implicitly typed as any due to above issue.
12-
import { globals } from "../jest.config";
12+
import { globals } from "../jest.config.cjs";
1313

1414
describe("Bubblebench", () => {
1515
/**

examples/benchmarks/bubblebench/ot/tests/demo.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { globals } from "../jest.config";
6+
import { globals } from "../jest.config.cjs";
77

88
describe("Bubblebench", () => {
99
describe("SharedOT", () => {

examples/benchmarks/bubblebench/sharedtree/tests/demo.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { globals } from "../jest.config";
6+
import { globals } from "../jest.config.cjs";
77

88
describe("Bubblebench", () => {
99
describe("SharedTree", () => {

examples/data-objects/canvas/test/canvas.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { globals } from "../jest.config";
6+
import { globals } from "../jest.config.cjs";
77

88
describe("canvas", () => {
99
beforeAll(async () => {

examples/data-objects/clicker/tests/clicker.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { globals } from "../jest.config";
6+
import { globals } from "../jest.config.cjs";
77
import { retryWithEventualValue } from "@fluidframework/test-utils";
88

99
describe("clicker", () => {

examples/data-objects/diceroller/tests/diceRoller.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { globals } from "../jest.config";
6+
import { globals } from "../jest.config.cjs";
77

88
describe("diceRoller", () => {
99
beforeAll(async () => {

examples/data-objects/inventory-app/tests/main.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { globals } from "../jest.config";
6+
import { globals } from "../jest.config.cjs";
77

88
describe.skip("Main", () => {
99
beforeAll(async () => {

examples/data-objects/multiview/container/tests/container.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { globals } from "../jest.config";
6+
import { globals } from "../jest.config.cjs";
77
import { strict as assert } from "assert";
88

99
describe("CoordinateContainerRuntimeFactory", () => {

examples/data-objects/todo/tests/todo.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { globals } from "../jest.config";
6+
import { globals } from "../jest.config.cjs";
77
import { retryWithEventualValue } from "@fluidframework/test-utils";
88

99
describe("ToDo", () => {
File renamed without changes.

examples/external-data/tests/taskList.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { globals } from "../jest.config";
6+
import { globals } from "../jest.config.cjs";
77

88
describe("taskList", () => {
99
beforeAll(async () => {

examples/service-clients/azure-client/external-controller/tests/diceRoller.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
33
* Licensed under the MIT License.
44
*/
5-
import { globals } from "../jest.config";
5+
import { globals } from "../jest.config.cjs";
66

77
// Tests disabled -- requires Tinylicious to be running, which our test environment doesn't do.
88
describe("external-controller-diceRoller", () => {

examples/version-migration/live-schema-upgrade/tests/diceRoller.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { globals } from "../jest.config";
6+
import { globals } from "../jest.config.cjs";
77

88
// Tests disabled -- requires Tinylicious to be running, which our test environment doesn't do.
99
describe("diceRoller", () => {

examples/version-migration/same-container/tests/inventoryList.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import { IMigrator } from "@fluid-example/example-utils";
7-
import { globals } from "../jest.config";
7+
import { globals } from "../jest.config.cjs";
88
import { IContainer } from "@fluidframework/container-definitions";
99

1010
// Tests disabled -- requires Tinylicious to be running, which our test environment doesn't do.

examples/version-migration/schema-upgrade/tests/inventoryList.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import { IMigrator } from "@fluid-example/example-utils";
7-
import { globals } from "../jest.config";
7+
import { globals } from "../jest.config.cjs";
88
import { IContainer } from "@fluidframework/container-definitions";
99

1010
// Tests disabled -- requires Tinylicious to be running, which our test environment doesn't do.

examples/version-migration/tree-shim/tests/inventoryList.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { globals } from "../jest.config";
6+
import { globals } from "../jest.config.cjs";
77

88
// Tests disabled -- requires Tinylicious to be running, which our test environment doesn't do.
99
describe("inventoryList", () => {

examples/view-integration/container-views/tests/diceRoller.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { globals } from "../jest.config";
6+
import { globals } from "../jest.config.cjs";
77

88
// Tests disabled -- requires Tinylicious to be running, which our test environment doesn't do.
99
describe("diceRoller", () => {

examples/view-integration/external-views/tests/diceRoller.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { globals } from "../jest.config";
6+
import { globals } from "../jest.config.cjs";
77

88
// Tests disabled -- requires Tinylicious to be running, which our test environment doesn't do.
99
describe("diceRoller", () => {

examples/view-integration/view-framework-sampler/tests/diceRoller.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { globals } from "../jest.config";
6+
import { globals } from "../jest.config.cjs";
77

88
// Tests disabled -- requires Tinylicious to be running, which our test environment doesn't do.
99
describe("diceRoller", () => {

experimental/PropertyDDS/examples/partial-checkout/tests/partial_checkout.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { globals } from "../jest.config";
6+
import { globals } from "../jest.config.cjs";
77

88
// Skipping these tests as the example doesn't seem to be working
99
describe.skip("partial checkout", () => {

experimental/PropertyDDS/examples/property-inspector/tests/property_inspector.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License.
44
*/
55

6-
import { globals } from "../jest.config";
6+
import { globals } from "../jest.config.cjs";
77

88
// Skipping these tests as the example doesn't seem to be working
99
describe.skip("Property Inspector", () => {
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
doc
22
node_modules
33
dist
4-
jest.config.js
4+
jest.config.cjs
55
src/index.d.ts

experimental/PropertyDDS/packages/property-binder/jest.config.js experimental/PropertyDDS/packages/property-binder/jest.config.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
33
* Licensed under the MIT License.
44
*/
5-
// jest.config.js
5+
// jest.config.cjs
66
module.exports = {
77
reporters: [
88
"default",

experimental/PropertyDDS/packages/property-inspector-table/jest.config.js experimental/PropertyDDS/packages/property-inspector-table/jest.config.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
33
* Licensed under the MIT License.
44
*/
5-
// jest.config.js
5+
// jest.config.cjs
66
module.exports = {
77
globals: {
88
"ts-jest": {

experimental/PropertyDDS/packages/property-proxy/.eslintignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ doc
22
node_modules
33
dist
44
lib
5-
jest.config.js
5+
jest.config.cjs
66
src/index.d.ts
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
doc
22
node_modules
33
dist
4-
jest.config.js
4+
jest.config.cjs
55
src/index.d.ts

packages/tools/devtools/devtools-browser-extension/e2e-tests/chromebrowserdevtool.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/// <reference types="puppeteer" />
88
/// <reference types="jest" />
99

10-
import { globals } from "../jest.config";
10+
import { globals } from "../jest.config.cjs";
1111
import { retryWithEventualValue } from "@fluidframework/test-utils";
1212

1313
describe("End to end tests", () => {

packages/tools/devtools/devtools-example/src/test/ExampleUi.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import { retryWithEventualValue } from "@fluidframework/test-utils";
7-
import { globals } from "../../jest.config";
7+
import { globals } from "../../jest.config.cjs";
88

99
describe("End to end tests", () => {
1010
/**

0 commit comments

Comments
 (0)