Skip to content

Commit

Permalink
loader,test: implement skipped test
Browse files Browse the repository at this point in the history
Implement how the skipped test should behave.
  • Loading branch information
jlenon7 committed Mar 28, 2023
1 parent 58abd80 commit 19491e6
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion test/es-module/test-esm-loader-programmatically.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,28 @@ import { spawnPromisified } from '../common/index.mjs';
describe('ESM: register loader programmatically', { concurrency: true }, () => {
it('should be able to register programmatically loader', {
skip: 'Skipping for now because --experimental-loader option is required to use the CustomModuleLoader'
}, async () => {});
}, async () => {
const { code, signal, stdout, stderr } = await spawnPromisified(execPath, [
'--no-warnings',
fixtures.path('/es-module-loaders/register-loader-entrypoint.mjs'),
]);

assert.strictEqual(stderr, '');
assert.strictEqual(code, 0);
assert.strictEqual(signal, null);

const lines = stdout.split('\n');

// Execute "resolve" hook for "register-loader-app.mjs".
assert.match(lines[0], /resolve register loader two/);
// Execute "load" hook for "register-loader-app.mjs".
assert.match(lines[1], /load register loader two/);

// Finally, gets in the application.
assert.match(lines[2], /running application/);

assert.strictEqual(lines[3], '');
});

it('should be able to register loader programmatically in the same chain of CLI loaders', async () => {
const { code, signal, stdout, stderr } = await spawnPromisified(execPath, [
Expand Down

0 comments on commit 19491e6

Please sign in to comment.