functionalscript 0.14.3 → 0.14.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/fs/dev/tf/module.js +10 -1
- package/package.json +1 -1
package/fs/dev/tf/module.js
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
|
+
var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
|
|
2
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
3
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
4
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
return path;
|
|
8
|
+
};
|
|
1
9
|
import { io } from "../../io/module.js";
|
|
2
10
|
import { loadModuleMap } from "../module.f.js";
|
|
3
11
|
import { isTest, parseTestSet } from "./module.f.js";
|
|
4
12
|
import * as nodeTest from 'node:test';
|
|
13
|
+
import { playwright } from "../../ci/config/module.f.js";
|
|
5
14
|
const isBun = typeof Bun !== 'undefined';
|
|
6
15
|
const isPlaywright = typeof process !== 'undefined' && process?.env?.PLAYWRIGHT_TEST !== undefined;
|
|
7
16
|
const createFramework = (fw) => (prefix, f) => fw.test(prefix, t => f((name, v) => t.test(name, v)));
|
|
8
17
|
// Bun doesn't support nested tests yet.
|
|
9
18
|
const createBunFramework = (fw) => (prefix, f) => f((name, v) => fw.test(`${prefix}: ${name}`, v));
|
|
10
19
|
const createPlaywrightFramework = async () => {
|
|
11
|
-
const pwTest = (await import(
|
|
20
|
+
const pwTest = (await import(__rewriteRelativeImportExtension(`@playwright/test@${playwright}`))).test;
|
|
12
21
|
return (prefix, f) => f((name, v) => pwTest(`${prefix}: ${name}`, v));
|
|
13
22
|
};
|
|
14
23
|
const framework = isPlaywright ? await createPlaywrightFramework() :
|