@rindo/core 2.17.3 → 2.17.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/testing/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Rindo Testing v2.17.3 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Testing v2.17.4 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  function _lazyRequire(e) {
5
5
  return new Proxy({}, {
@@ -1323,21 +1323,23 @@ const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"
1323
1323
  if (!r.includes(t.code) && (n = t.messageText, isIterable(t.next))) for (const r of t.next) n += flattenDiagnosticMessageText(e, r);
1324
1324
  return s && (n = n.replace("type 'RindoConfig'", "Rindo Config"), n = n.replace("Object literal may only specify known properties, but ", ""),
1325
1325
  n = n.replace("Object literal may only specify known properties, and ", "")), n.trim();
1326
- }, isOutputTargetDistLazy = e => e.type === DIST_LAZY, isOutputTargetWww = e => e.type === WWW, DIST_LAZY = "dist-lazy", WWW = "www", isJest27TransformOptions = e => "object" == typeof e && e.hasOwnProperty("config");
1326
+ }, isOutputTargetDistLazy = e => e.type === DIST_LAZY, isOutputTargetWww = e => e.type === WWW, DIST_LAZY = "dist-lazy", WWW = "www", isJest27TransformOptions = e => null != e && "object" == typeof e && e.hasOwnProperty("config");
1327
1327
 
1328
1328
  let _tsCompilerOptions = null, _tsCompilerOptionsKey = null;
1329
1329
 
1330
1330
  const jestPreprocessor = {
1331
1331
  process(e, t, r, s) {
1332
- if (isJest27TransformOptions(r) && (s = r.config), function n(e, t) {
1333
- const r = e.split(".").pop().toLowerCase().split("?")[0];
1334
- if ("ts" === r || "tsx" === r || "jsx" === r) return !0;
1335
- if ("mjs" === r) return !0;
1336
- if ("js" === r) {
1332
+ if (isJest27TransformOptions(r) && (s = r.config), !s) throw "Unable to find Jest transformation options.";
1333
+ if (function n(e, t) {
1334
+ var r;
1335
+ const s = (null !== (r = e.split(".").pop()) && void 0 !== r ? r : "").toLowerCase().split("?")[0];
1336
+ if ("ts" === s || "tsx" === s || "jsx" === s) return !0;
1337
+ if ("mjs" === s) return !0;
1338
+ if ("js" === s) {
1337
1339
  if (t.includes("import ") || t.includes("import.") || t.includes("import(")) return !0;
1338
1340
  if (t.includes("export ")) return !0;
1339
1341
  }
1340
- return "css" === r;
1342
+ return "css" === s;
1341
1343
  }(t, e)) {
1342
1344
  const r = {
1343
1345
  file: t,
@@ -1354,7 +1356,8 @@ const jestPreprocessor = {
1354
1356
  return e;
1355
1357
  },
1356
1358
  getCacheKey(e, t, r, s) {
1357
- if (isJest27TransformOptions(r) && (s = r.config), !_tsCompilerOptionsKey) {
1359
+ if (isJest27TransformOptions(r) && (s = r.config), !s) throw "Unable to find Jest transformation options.";
1360
+ if (!_tsCompilerOptionsKey) {
1358
1361
  const e = getCompilerOptions(s.rootDir);
1359
1362
  _tsCompilerOptionsKey = JSON.stringify(e);
1360
1363
  }
@@ -3046,7 +3049,7 @@ const createSystem = e => {
3046
3049
  u("/");
3047
3050
  const D = {
3048
3051
  name: "in-memory",
3049
- version: "2.17.3",
3052
+ version: "2.17.4",
3050
3053
  events: i,
3051
3054
  access: async e => c(e),
3052
3055
  accessSync: c,
@@ -4000,6 +4003,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
4000
4003
  logger: mockLogger(),
4001
4004
  outputTargets: null !== (t = r.outputTargets) && void 0 !== t ? t : [],
4002
4005
  sys: createTestingSystem(),
4006
+ testing: {},
4003
4007
  ...e
4004
4008
  };
4005
4009
  }, exports.mockWindow = function mockWindow(e = null) {
@@ -12,5 +12,5 @@ export declare function buildJestArgv(config: d.ValidatedConfig): Config.Argv;
12
12
  * @param config the Rindo config to use while generating Jest CLI arguments
13
13
  * @returns the Jest Config to attach to the `argv` argument
14
14
  */
15
- export declare function buildJestConfig(config: d.Config): string;
15
+ export declare function buildJestConfig(config: d.ValidatedConfig): string;
16
16
  export declare function getProjectListFromCLIArgs(config: d.Config, argv: Config.Argv): Config.Path[];
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/testing",
3
- "version": "2.17.3",
3
+ "version": "2.17.4",
4
4
  "description": "Rindo testing suite.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",