@gjsify/unit 0.0.2 → 0.0.3
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/lib/cjs/index.js +19 -49
- package/lib/cjs/spy.js +3 -22
- package/package.json +4 -4
package/lib/cjs/index.js
CHANGED
|
@@ -1,48 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var src_exports = {};
|
|
30
|
-
__export(src_exports, {
|
|
31
|
-
afterEach: () => afterEach,
|
|
32
|
-
assert: () => assert,
|
|
33
|
-
beforeEach: () => beforeEach,
|
|
34
|
-
default: () => src_default,
|
|
35
|
-
describe: () => describe,
|
|
36
|
-
expect: () => expect,
|
|
37
|
-
it: () => it,
|
|
38
|
-
on: () => on,
|
|
39
|
-
print: () => print,
|
|
40
|
-
run: () => run
|
|
41
|
-
});
|
|
42
|
-
module.exports = __toCommonJS(src_exports);
|
|
43
|
-
var import_gjs = require("@girs/gjs");
|
|
44
|
-
__reExport(src_exports, require("./spy.js"), module.exports);
|
|
45
|
-
var import_assert = __toESM(require("assert"), 1);
|
|
1
|
+
import "@girs/gjs";
|
|
2
|
+
export * from "./spy.js";
|
|
3
|
+
import nodeAssert from "assert";
|
|
46
4
|
const mainloop = globalThis?.imports?.mainloop;
|
|
47
5
|
let countTestsOverall = 0;
|
|
48
6
|
let countTestsFailed = 0;
|
|
@@ -279,12 +237,12 @@ const assert = function(success, message) {
|
|
|
279
237
|
if (!success) {
|
|
280
238
|
++countTestsFailed;
|
|
281
239
|
}
|
|
282
|
-
(
|
|
240
|
+
nodeAssert(success, message);
|
|
283
241
|
};
|
|
284
242
|
assert.strictEqual = function(actual, expected, message) {
|
|
285
243
|
++countTestsOverall;
|
|
286
244
|
try {
|
|
287
|
-
|
|
245
|
+
nodeAssert.strictEqual(actual, expected, message);
|
|
288
246
|
} catch (error) {
|
|
289
247
|
++countTestsFailed;
|
|
290
248
|
throw error;
|
|
@@ -300,7 +258,7 @@ assert.throws = function(promiseFn, ...args) {
|
|
|
300
258
|
}
|
|
301
259
|
if (!error)
|
|
302
260
|
++countTestsFailed;
|
|
303
|
-
|
|
261
|
+
nodeAssert.throws(() => {
|
|
304
262
|
if (error)
|
|
305
263
|
throw error;
|
|
306
264
|
}, args[0], args[1]);
|
|
@@ -308,7 +266,7 @@ assert.throws = function(promiseFn, ...args) {
|
|
|
308
266
|
assert.deepStrictEqual = function(actual, expected, message) {
|
|
309
267
|
++countTestsOverall;
|
|
310
268
|
try {
|
|
311
|
-
|
|
269
|
+
nodeAssert.deepStrictEqual(actual, expected, message);
|
|
312
270
|
} catch (error) {
|
|
313
271
|
++countTestsFailed;
|
|
314
272
|
throw error;
|
|
@@ -388,3 +346,15 @@ var src_default = {
|
|
|
388
346
|
describe,
|
|
389
347
|
print
|
|
390
348
|
};
|
|
349
|
+
export {
|
|
350
|
+
afterEach,
|
|
351
|
+
assert,
|
|
352
|
+
beforeEach,
|
|
353
|
+
src_default as default,
|
|
354
|
+
describe,
|
|
355
|
+
expect,
|
|
356
|
+
it,
|
|
357
|
+
on,
|
|
358
|
+
print,
|
|
359
|
+
run
|
|
360
|
+
};
|
package/lib/cjs/spy.js
CHANGED
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var spy_exports = {};
|
|
19
|
-
__export(spy_exports, {
|
|
20
|
-
spy: () => spy
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(spy_exports);
|
|
23
1
|
function spy(f) {
|
|
24
2
|
const calls = [];
|
|
25
3
|
function spy2(...args) {
|
|
@@ -156,3 +134,6 @@ function isReturned(call) {
|
|
|
156
134
|
function isThrown(call) {
|
|
157
135
|
return call.type === "throw";
|
|
158
136
|
}
|
|
137
|
+
export {
|
|
138
|
+
spy
|
|
139
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/unit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "A BDD-style testing framework for Gjs",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
"homepage": "https://github.com/gjsify/unit#readme",
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@girs/gjs": "^3.1.0",
|
|
52
|
-
"@gjsify/cli": "^0.0.
|
|
52
|
+
"@gjsify/cli": "^0.0.3",
|
|
53
53
|
"typescript": "^5.1.3"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@gjsify/assert": "^0.0.
|
|
57
|
-
"@gjsify/process": "^0.0.
|
|
56
|
+
"@gjsify/assert": "^0.0.3",
|
|
57
|
+
"@gjsify/process": "^0.0.3"
|
|
58
58
|
}
|
|
59
59
|
}
|