fix(#473) add Ajv to the test runtime

This commit is contained in:
Michał Szymborski 2023-10-09 20:13:29 +02:00
parent 524c3f8445
commit 2b25a0be18

View File

@ -18,13 +18,15 @@ const TestResults = require('../test-results');
const { cleanJson } = require('../utils'); const { cleanJson } = require('../utils');
// Inbuilt Library Support // Inbuilt Library Support
const ajv = require('ajv');
const atob = require('atob'); const atob = require('atob');
const axios = require('axios');
const btoa = require('btoa'); const btoa = require('btoa');
const lodash = require('lodash'); const lodash = require('lodash');
const moment = require('moment'); const moment = require('moment');
const uuid = require('uuid'); const uuid = require('uuid');
const nanoid = require('nanoid'); const nanoid = require('nanoid');
const axios = require('axios');
const fetch = require('node-fetch');
const CryptoJS = require('crypto-js'); const CryptoJS = require('crypto-js');
class TestRuntime { class TestRuntime {
@ -111,14 +113,16 @@ class TestRuntime {
punycode, punycode,
zlib, zlib,
// 3rd party libs // 3rd party libs
atob, ajv,
axios,
btoa, btoa,
atob,
lodash, lodash,
moment, moment,
uuid, uuid,
nanoid, nanoid,
axios,
chai, chai,
'node-fetch': fetch,
'crypto-js': CryptoJS, 'crypto-js': CryptoJS,
...whitelistedModules, ...whitelistedModules,
fs: allowScriptFilesystemAccess ? fs : undefined fs: allowScriptFilesystemAccess ? fs : undefined