From aaca5bd7e3849e515fc70e71fa78f9f433c10368 Mon Sep 17 00:00:00 2001 From: Kushal Joshi Date: Sun, 13 Jul 2025 02:45:03 +0200 Subject: [PATCH 1/2] renamed bsconfig and updated output and test-output suffixes --- .../__snapshots__/expect_test.bs.js.snap | 7 ------ bsconfig.json | 22 ----------------- jest.config.js | 24 +++++++++---------- 3 files changed, 12 insertions(+), 41 deletions(-) delete mode 100644 __tests__/__snapshots__/expect_test.bs.js.snap delete mode 100644 bsconfig.json diff --git a/__tests__/__snapshots__/expect_test.bs.js.snap b/__tests__/__snapshots__/expect_test.bs.js.snap deleted file mode 100644 index 1847415..0000000 --- a/__tests__/__snapshots__/expect_test.bs.js.snap +++ /dev/null @@ -1,7 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Expect toMatchSnapshot 1`] = `"foo"`; - -exports[`Expect toMatchSnapshotWithName: bar 1`] = `"foo"`; - -exports[`Expect toThrowErrorMatchingSnapshot 1`] = `"foo error"`; diff --git a/bsconfig.json b/bsconfig.json deleted file mode 100644 index 2938d1e..0000000 --- a/bsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@glennsl/rescript-jest", - "namespace": false, - "bsc-flags": ["-bs-no-version-header", "-bs-super-errors"], - "suffix": ".bs.js", - "package-specs": { - "module": "commonjs", - "in-source": true - }, - "sources": [ - { - "dir": "src" - }, - { - "dir": "__tests__", - "type": "dev" - } - ], - "warnings": { - "number": "-44" - } -} diff --git a/jest.config.js b/jest.config.js index 69ac229..34d5408 100644 --- a/jest.config.js +++ b/jest.config.js @@ -38,8 +38,8 @@ module.exports = { "json", "html", "text", - // "lcov", - // "clover" + // "lcov", + // "clover" ], // An object that configures minimum threshold enforcement for coverage results @@ -83,11 +83,11 @@ module.exports = { moduleFileExtensions: [ "js", "mjs", - // "jsx", - // "ts", - // "tsx", - // "json", - // "node" + // "jsx", + // "ts", + // "tsx", + // "json", + // "node" ], // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module @@ -163,7 +163,7 @@ module.exports = { testMatch: [ //"**/__tests__/**/*.[jt]s?(x)", "**/__tests__/**/*_test.mjs", - "**/__tests__/**/*_test.bs.js", + "**/__tests__/**/*_test.res.mjs", //"**/?(*.)+(spec|test).[tj]s?(x)" ], @@ -190,15 +190,15 @@ module.exports = { // A map from regular expressions to paths to transformers transform: { "^.+\.m?js$": "babel-jest" - // "^.+\.js$": "babel-jest" + // "^.+\.js$": "babel-jest" }, // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation transformIgnorePatterns: [ "node_modules/(?!(rescript)/)" - // "/node_modules/", - // "\\.pnp\\.[^\\/]+$", - // "/src/" + // "/node_modules/", + // "\\.pnp\\.[^\\/]+$", + // "/src/" ], // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them From 5a7743ac0be45409c9f9f210871f7606521abd75 Mon Sep 17 00:00:00 2001 From: Kushal Joshi Date: Sun, 13 Jul 2025 02:47:48 +0200 Subject: [PATCH 2/2] replacement rescript.json file and test snap --- .../__snapshots__/expect_test.res.mjs.snap | 7 ++++++ rescript.json | 22 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 __tests__/__snapshots__/expect_test.res.mjs.snap create mode 100644 rescript.json diff --git a/__tests__/__snapshots__/expect_test.res.mjs.snap b/__tests__/__snapshots__/expect_test.res.mjs.snap new file mode 100644 index 0000000..1847415 --- /dev/null +++ b/__tests__/__snapshots__/expect_test.res.mjs.snap @@ -0,0 +1,7 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Expect toMatchSnapshot 1`] = `"foo"`; + +exports[`Expect toMatchSnapshotWithName: bar 1`] = `"foo"`; + +exports[`Expect toThrowErrorMatchingSnapshot 1`] = `"foo error"`; diff --git a/rescript.json b/rescript.json new file mode 100644 index 0000000..c35b59a --- /dev/null +++ b/rescript.json @@ -0,0 +1,22 @@ +{ + "name": "@glennsl/rescript-jest", + "namespace": false, + "bsc-flags": ["-bs-no-version-header", "-bs-super-errors"], + "suffix": ".res.mjs", + "package-specs": { + "module": "commonjs", + "in-source": true + }, + "sources": [ + { + "dir": "src" + }, + { + "dir": "__tests__", + "type": "dev" + } + ], + "warnings": { + "number": "-44" + } +}