diff --git a/.eslintrc.cjs b/.eslintrc.cjs index ee810017..22297d3a 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,23 +1,22 @@ -const deasync = require('deasync'); // powerful magic +main(); -const promiseSync = deasync((promise, cb) => { - console.log('wait for promise, before'); - promise +async function main() { + +const importSync = name => + // promiseSync( + import(name) .then(result => { console.log('promise resolved'); - cb(null, result); + return result; }) .catch(error => { console.log('promise error'); - cb(error); }); -}); - -const importSync = name => promiseSync(import(name)); +// ); // Look, no await needed here! console.log('import sync before'); -const jestConfig = importSync('./jest.config.js').default; +const jestConfig = (await importSync('./jest.config')).default; console.log('import sync after'); const testGlobals = {}; @@ -102,3 +101,5 @@ module.exports = { }, ], }; + +} diff --git a/jest.config.js b/jest.config.js index e66bfbd4..89f18fe7 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,5 +1,5 @@ import path from 'path'; -import server from './test/config/server.js'; +import server from './test/config/server'; console.log('jest.config');