2022-02-09 00:23:36 -05:00
|
|
|
'use strict';
|
2024-04-21 18:53:08 +02:00
|
|
|
|
|
|
|
const {
|
|
|
|
ObjectAssign,
|
|
|
|
ObjectDefineProperty,
|
|
|
|
} = primordials;
|
|
|
|
|
2024-03-19 11:38:17 -04:00
|
|
|
const { test, suite, before, after, beforeEach, afterEach } = require('internal/test_runner/harness');
|
2022-08-15 12:12:11 +03:00
|
|
|
const { run } = require('internal/test_runner/runner');
|
2022-02-09 00:23:36 -05:00
|
|
|
|
|
|
|
module.exports = test;
|
2022-08-15 12:12:11 +03:00
|
|
|
ObjectAssign(module.exports, {
|
|
|
|
after,
|
|
|
|
afterEach,
|
|
|
|
before,
|
|
|
|
beforeEach,
|
2024-03-19 11:38:17 -04:00
|
|
|
describe: suite,
|
|
|
|
it: test,
|
2022-08-15 12:12:11 +03:00
|
|
|
run,
|
2024-03-19 11:38:17 -04:00
|
|
|
suite,
|
2022-08-15 12:12:11 +03:00
|
|
|
test,
|
|
|
|
});
|
2022-04-04 18:36:40 -04:00
|
|
|
|
|
|
|
let lazyMock;
|
|
|
|
|
|
|
|
ObjectDefineProperty(module.exports, 'mock', {
|
|
|
|
__proto__: null,
|
|
|
|
configurable: true,
|
|
|
|
enumerable: true,
|
|
|
|
get() {
|
|
|
|
if (lazyMock === undefined) {
|
2023-06-22 01:01:52 -03:00
|
|
|
const { MockTracker } = require('internal/test_runner/mock/mock');
|
2022-04-04 18:36:40 -04:00
|
|
|
|
|
|
|
lazyMock = new MockTracker();
|
|
|
|
}
|
|
|
|
|
|
|
|
return lazyMock;
|
|
|
|
},
|
|
|
|
});
|
2024-05-18 12:32:41 -04:00
|
|
|
|
2024-11-19 12:37:35 -05:00
|
|
|
let lazySnapshot;
|
2024-05-18 12:32:41 -04:00
|
|
|
|
2024-11-19 12:37:35 -05:00
|
|
|
ObjectDefineProperty(module.exports, 'snapshot', {
|
|
|
|
__proto__: null,
|
|
|
|
configurable: true,
|
|
|
|
enumerable: true,
|
|
|
|
get() {
|
|
|
|
if (lazySnapshot === undefined) {
|
|
|
|
const {
|
|
|
|
setDefaultSnapshotSerializers,
|
|
|
|
setResolveSnapshotPath,
|
|
|
|
} = require('internal/test_runner/snapshot');
|
|
|
|
|
|
|
|
lazySnapshot = {
|
|
|
|
__proto__: null,
|
|
|
|
setDefaultSnapshotSerializers,
|
|
|
|
setResolveSnapshotPath,
|
|
|
|
};
|
|
|
|
}
|
2024-05-18 12:32:41 -04:00
|
|
|
|
2024-11-19 12:37:35 -05:00
|
|
|
return lazySnapshot;
|
|
|
|
},
|
|
|
|
});
|
2025-01-04 13:30:04 -05:00
|
|
|
|
|
|
|
ObjectDefineProperty(module.exports, 'assert', {
|
|
|
|
__proto__: null,
|
|
|
|
configurable: true,
|
|
|
|
enumerable: true,
|
|
|
|
get() {
|
|
|
|
const { register } = require('internal/test_runner/assert');
|
|
|
|
const assert = { __proto__: null, register };
|
|
|
|
ObjectDefineProperty(module.exports, 'assert', assert);
|
|
|
|
return assert;
|
|
|
|
},
|
|
|
|
});
|