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