You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

24 lines
700 B

const { TextDecoder, TextEncoder } = require('util');
const polyfillEncoder = () => {
if (typeof globalThis.TextEncoder === 'undefined') {
globalThis.TextEncoder = TextEncoder;
globalThis.TextDecoder = TextDecoder;
}
};
const resolveTestEnvOptions = (options) => {
const globalTestEnvOptions = globalThis.ngJest?.testEnvironmentOptions;
if (globalTestEnvOptions) {
console.warn(
'Setting testEnvironmentOptions via globalThis.ngJest is deprecated. Please provide testEnvironmentOptions via function argument',
);
}
return globalTestEnvOptions ?? options;
};
module.exports = {
polyfillEncoder,
resolveTestEnvOptions,
};