/// import fs from 'node:fs'; import { createRequire } from 'node:module'; import path from 'node:path'; const require = createRequire(__filename); globalThis.lynx = { requireModuleAsync: rstest.fn(function requireModuleAsync(request, callback) { return Promise.resolve().then(() => { try { callback(null, require(path.join(__dirname, request))); } catch (error) { callback(error); } }); }), }; it('should have dynamic chunks', () => { expect( fs.existsSync( path.join( __dirname, 'css_development_dynamic_css.' + path.basename(__filename).replace('.js', '.css'), ), ), ).toBeTruthy(); }); it('should work with chunk loading require', async function() { await import('./dynamic.css').then(module => { expect(module).not.toBeUndefined(); }); });