Add node modules and compiled JavaScript from main (#57)
Co-authored-by: Oliver King <oking3@uncc.edu>
This commit is contained in:
parent
d893f27da9
commit
7f7e5ba5ea
6750 changed files with 1745644 additions and 10860 deletions
21
node_modules/jest-environment-node/LICENSE
generated
vendored
Normal file
21
node_modules/jest-environment-node/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) Facebook, Inc. and its affiliates.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
30
node_modules/jest-environment-node/build/index.d.ts
generated
vendored
Normal file
30
node_modules/jest-environment-node/build/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
/// <reference types="node" />
|
||||
import { Context, Script } from 'vm';
|
||||
import type { Config, Global } from '@jest/types';
|
||||
import { ModuleMocker } from 'jest-mock';
|
||||
import { LegacyFakeTimers, ModernFakeTimers } from '@jest/fake-timers';
|
||||
import type { JestEnvironment } from '@jest/environment';
|
||||
declare type Timer = {
|
||||
id: number;
|
||||
ref: () => Timer;
|
||||
unref: () => Timer;
|
||||
};
|
||||
declare class NodeEnvironment implements JestEnvironment {
|
||||
context: Context | null;
|
||||
fakeTimers: LegacyFakeTimers<Timer> | null;
|
||||
fakeTimersModern: ModernFakeTimers | null;
|
||||
global: Global.Global;
|
||||
moduleMocker: ModuleMocker | null;
|
||||
constructor(config: Config.ProjectConfig);
|
||||
setup(): Promise<void>;
|
||||
teardown(): Promise<void>;
|
||||
runScript<T = unknown>(script: Script): T | null;
|
||||
getVmContext(): Context | null;
|
||||
}
|
||||
export = NodeEnvironment;
|
165
node_modules/jest-environment-node/build/index.js
generated
vendored
Normal file
165
node_modules/jest-environment-node/build/index.js
generated
vendored
Normal file
|
@ -0,0 +1,165 @@
|
|||
'use strict';
|
||||
|
||||
function _vm() {
|
||||
const data = require('vm');
|
||||
|
||||
_vm = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _jestMock() {
|
||||
const data = require('jest-mock');
|
||||
|
||||
_jestMock = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _jestUtil() {
|
||||
const data = require('jest-util');
|
||||
|
||||
_jestUtil = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _fakeTimers() {
|
||||
const data = require('@jest/fake-timers');
|
||||
|
||||
_fakeTimers = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
class NodeEnvironment {
|
||||
constructor(config) {
|
||||
_defineProperty(this, 'context', void 0);
|
||||
|
||||
_defineProperty(this, 'fakeTimers', void 0);
|
||||
|
||||
_defineProperty(this, 'fakeTimersModern', void 0);
|
||||
|
||||
_defineProperty(this, 'global', void 0);
|
||||
|
||||
_defineProperty(this, 'moduleMocker', void 0);
|
||||
|
||||
this.context = (0, _vm().createContext)();
|
||||
const global = (this.global = (0, _vm().runInContext)(
|
||||
'this',
|
||||
Object.assign(this.context, config.testEnvironmentOptions)
|
||||
));
|
||||
global.global = global;
|
||||
global.clearInterval = clearInterval;
|
||||
global.clearTimeout = clearTimeout;
|
||||
global.setInterval = setInterval;
|
||||
global.setTimeout = setTimeout;
|
||||
global.ArrayBuffer = ArrayBuffer; // TextEncoder (global or via 'util') references a Uint8Array constructor
|
||||
// different than the global one used by users in tests. This makes sure the
|
||||
// same constructor is referenced by both.
|
||||
|
||||
global.Uint8Array = Uint8Array; // URL and URLSearchParams are global in Node >= 10
|
||||
|
||||
if (typeof URL !== 'undefined' && typeof URLSearchParams !== 'undefined') {
|
||||
global.URL = URL;
|
||||
global.URLSearchParams = URLSearchParams;
|
||||
} // TextDecoder and TextDecoder are global in Node >= 11
|
||||
|
||||
if (
|
||||
typeof TextEncoder !== 'undefined' &&
|
||||
typeof TextDecoder !== 'undefined'
|
||||
) {
|
||||
global.TextEncoder = TextEncoder;
|
||||
global.TextDecoder = TextDecoder;
|
||||
} // queueMicrotask is global in Node >= 11
|
||||
|
||||
if (typeof queueMicrotask !== 'undefined') {
|
||||
global.queueMicrotask = queueMicrotask;
|
||||
}
|
||||
|
||||
(0, _jestUtil().installCommonGlobals)(global, config.globals);
|
||||
this.moduleMocker = new (_jestMock().ModuleMocker)(global);
|
||||
|
||||
const timerIdToRef = id => ({
|
||||
id,
|
||||
|
||||
ref() {
|
||||
return this;
|
||||
},
|
||||
|
||||
unref() {
|
||||
return this;
|
||||
}
|
||||
});
|
||||
|
||||
const timerRefToId = timer => (timer && timer.id) || undefined;
|
||||
|
||||
const timerConfig = {
|
||||
idToRef: timerIdToRef,
|
||||
refToId: timerRefToId
|
||||
};
|
||||
this.fakeTimers = new (_fakeTimers().LegacyFakeTimers)({
|
||||
config,
|
||||
global,
|
||||
moduleMocker: this.moduleMocker,
|
||||
timerConfig
|
||||
});
|
||||
this.fakeTimersModern = new (_fakeTimers().ModernFakeTimers)({
|
||||
config,
|
||||
global
|
||||
});
|
||||
}
|
||||
|
||||
async setup() {}
|
||||
|
||||
async teardown() {
|
||||
if (this.fakeTimers) {
|
||||
this.fakeTimers.dispose();
|
||||
}
|
||||
|
||||
if (this.fakeTimersModern) {
|
||||
this.fakeTimersModern.dispose();
|
||||
}
|
||||
|
||||
this.context = null;
|
||||
this.fakeTimers = null;
|
||||
this.fakeTimersModern = null;
|
||||
} // TS infers the return type to be `any`, since that's what `runInContext`
|
||||
// returns.
|
||||
|
||||
runScript(script) {
|
||||
if (this.context) {
|
||||
return script.runInContext(this.context);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
getVmContext() {
|
||||
return this.context;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = NodeEnvironment;
|
27
node_modules/jest-environment-node/package.json
generated
vendored
Normal file
27
node_modules/jest-environment-node/package.json
generated
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"name": "jest-environment-node",
|
||||
"version": "26.3.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/facebook/jest.git",
|
||||
"directory": "packages/jest-environment-node"
|
||||
},
|
||||
"license": "MIT",
|
||||
"main": "build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
"dependencies": {
|
||||
"@jest/environment": "^26.3.0",
|
||||
"@jest/fake-timers": "^26.3.0",
|
||||
"@jest/types": "^26.3.0",
|
||||
"@types/node": "*",
|
||||
"jest-mock": "^26.3.0",
|
||||
"jest-util": "^26.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10.14.2"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "3a7e06fe855515a848241bb06a6f6e117847443d"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue