Skip to content
This repository has been archived by the owner on Aug 31, 2018. It is now read-only.

Commit

Permalink
test: add workers + ES Module test
Browse files Browse the repository at this point in the history
PR-URL: #117
Reviewed-By: Stephen Belanger <[email protected]>
Reviewed-By: Olivia Hugger <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
  • Loading branch information
addaleax committed Oct 24, 2017
1 parent d934a8d commit 8ecabc1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/fixtures/worker-script.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import worker from 'worker';

worker.postMessage('Hello, world!');
11 changes: 11 additions & 0 deletions test/parallel/test-worker-esmodule.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
'use strict';
// Flags: --experimental-modules
const common = require('../common');
const fixtures = require('../common/fixtures');
const assert = require('assert');
const { Worker } = require('worker');

const w = new Worker(fixtures.path('worker-script.mjs'));
w.on('message', common.mustCall((message) => {
assert.strictEqual(message, 'Hello, world!');
}));

0 comments on commit 8ecabc1

Please sign in to comment.