Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix windows bugs & tests #1965

Merged
merged 24 commits into from
Sep 22, 2018
Merged

Fix windows bugs & tests #1965

merged 24 commits into from
Sep 22, 2018

Conversation

DeMoorJasper
Copy link
Member

@DeMoorJasper DeMoorJasper commented Aug 30, 2018

This is an attempt to fix as many windows bugs and test failures as possible.

  • Fixes pug test
  • Fixes failing globs on windows
  • Improves delayed deleting of dist to be faster and recursively sleep untill it works.
  • Skips scope hoisting tests on windows, untill someone or I figure out why scope hoisting locks the dist file on windows. (and throws a EPERM error)
  • Fix resolver tests
  • Fix symlinks
  • Fix watcher tests
  • Make AppVeyor config slightly more lightweight so it runs faster

src/Resolver.js Outdated
@@ -147,7 +147,7 @@ class Resolver {

default:
// Module
return path.normalize(filename);
return path.normalize(filename).replace(/\\/g, '/');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this even normalizes the filename?

This wouldn't do anything if it really is a node_module right?

some-module => some-module
some/sub/module/file.js => some/sub/module/file.js

I'll remove it for performance reasons. (and it doesn't fail any tests, it even fixes one on windows)

@@ -3,7 +3,6 @@ environment:
matrix:
- nodejs_version: "6"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Travis already tests Node 6 compatibility and the tests that break on windows that don't break on Travis are usually related to the filesystem, which is the same on Node 8.

Removing this would make it as fast as Travis, this way we don't have to wait hours before AppVeyor catches up

@DeMoorJasper DeMoorJasper changed the title Fix windows test environment Fix windows bugs & tests Aug 31, 2018
@DeMoorJasper
Copy link
Member Author

DeMoorJasper commented Aug 31, 2018

AppVeyor is now just as stable/unstable as Travis 🎉🎉🎉

Hopefully this will prevent us from breaking stuff for windows users.

Copy link
Contributor

@peanutbother peanutbother left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

path.join() should be used whenever possible to avoid breaking paths on different OSes

this should solve some windows issues when initially used something like __dirname + somePath

test/pug.js Outdated
__dirname + '/integration/pug-include-extends/expect.html',
'utf-8'
const html = normaliseNewlines(
await fs.readFile(__dirname + '/dist/index.html', 'utf-8')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why no path.join() here?

test/pug.js Outdated
);
const expect = normaliseNewlines(
await fs.readFile(
__dirname + '/integration/pug-include-extends/expect.html',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also why no path.join() here?

test/resolver.js Outdated

describe('resolver', function() {
let resolver;
before(async function() {
await rimraf(__dirname + '/input');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be replaced by await rimraf(path.join(__dirname, '/input'))

test/watcher.js Outdated
@@ -25,27 +30,24 @@ describe('watcher', function() {
});

it('should rebuild on file change', async function() {
await ncp(__dirname + '/integration/commonjs', __dirname + '/input');
await ncp(__dirname + '/integration/commonjs', inputDir);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be replaced with await ncp(path.join(__dirname, '/integration/commonjs'), inputDir);

test/watcher.js Outdated

b = bundler(__dirname + '/input/index.js', {watch: true});
b = bundler(inputDir + '/index.js', {watch: true});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should use path.join()

test/watcher.js Outdated
babelrc.presets[0][1].targets.browsers.push('IE >= 11');

await sleep(100);

await fs.writeFile(__dirname + '/input/.babelrc', JSON.stringify(babelrc));
await fs.writeFile(inputDir + '/.babelrc', JSON.stringify(babelrc));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should use path.join()

test/watcher.js Outdated
await ncp(
__dirname + '/integration/commonjs-with-symlinks/',
__dirname + '/input'
await ncp(__dirname + '/integration/commonjs-with-symlinks/', inputDir);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should use path.join()

test/watcher.js Outdated
);

b = bundler(__dirname + '/input/src/index.js', {
b = bundler(inputDir + '/src/index.js', {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should use path.join()

test/watcher.js Outdated
__dirname + '/input/local.js',
'exports.a = 5; exports.b = 5;'
);
await fs.writeFile(inputDir + '/local.js', 'exports.a = 5; exports.b = 5;');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should use path.join()

const inputDir = __dirname + '/input';
await mkdirp(path.join(inputDir, 'node_modules'));
await ncp(
path.join(__dirname + '/integration/babel-node-modules-source'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__dirname + '/integration/babel-node-modules-source' should be __dirname, '/integration/babel-node-modules-source'

@DeMoorJasper
Copy link
Member Author

DeMoorJasper commented Sep 11, 2018

@peanutbother I'll change it, but that didn't cause any test failures.

Copy link
Contributor

@peanutbother peanutbother left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! I don't see any directory-join related issues anymore!
Now only fs in the browser and something about the plugins tests needs to be fixed.
Additionally, there's an issue with web assembly in node 10 on Travis, but I don't know anything helpful about that since I'm still new to wasm.

A word about failing tests on travis:
We should include rust in the template so it is available at test time (travis supports it)

tl;dr

I would approve this PR since it fixes some bugs on windows, I even could close #1990
Scope-Hoisting still needs to be investigated, but thats for another issue.
Resolver tests might fail when not run in admin context, see linked issues down below.

[windows 💻 ]

Finally this test brings a warning for windows users about scope-hoisting 👍
An issue on windows: symlinks are not permitted. (EPERM)
see nodejs/node-v0.x-archive#2274 and nodejs/node#18518
I'm afraid to run this with admin privileges, but tested anyway and in escalated privilege mode and it works.
wasm has errors, but I can't say anything helpful there but show the logs:

(click) test logs

elevated test

yarn run v1.9.4
$ cross-env NODE_ENV=test mocha
WARNING: Scope hoisting tests are disabled on windows due to filesystem errors. Feel free to look into this and contribute a fix!


  Asset
    √ should include default implementations
    √ should support overriding the filename of the root bundle (681ms)
    √ should have backward compatibility for package field
    addURLDependency
      √ should ignore urls
      √ should ignore empty string
      √ should generate bundle name
      √ should preserve query and hash
      √ should resolve slash
      √ should resolve tilde

  autoinstall
npm notice created a lockfile as package-lock.json. You should commit this file.
+ [email protected]
added 1 package from 2 contributors and audited 1 package in 2.44s
found 0 vulnerabilities

    √ should install lodash using npm and save dev dependency to package.json (3707ms)
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
└─ [email protected]
info All dependencies
└─ [email protected]
    √ should install lodash using yarn and save dev dependency to package.json (2349ms)

  bundler
    √ should bundle once before exporting middleware (81ms)
    √ should defer bundling if a bundle is pending (110ms)
    √ should enforce asset type path to be a string
    √ should enforce setup before bundling
    √ should support multiple entry points (55ms)
    √ should support multiple entry points as a glob (46ms)

  content hashing
    √ should update content hash when content changes (1217ms)
    √ should update content hash when raw asset changes (130ms)

  css
    √ should produce two bundles when importing a CSS file (83ms)
    √ should support loading a CSS bundle along side dynamic imports (234ms)
    √ should support importing CSS from a CSS file (84ms)
    √ should support linking to assets with url() from CSS (76ms)
    √ should support linking to assets with url() from CSS in production (91ms)
    √ should support transforming with postcss (197ms)
    √ should support transforming with postcss twice with the same result (121ms)
    √ should minify CSS in production mode (96ms)
info No lockfile found.
[1/4] Resolving packages...
warning [email protected]: 'postcss-cssnext' has been deprecated in favor of 'postcss-preset-env'. Read more at https://moox.io/blog/deprecating-cssnext/
warning postcss-cssnext > autoprefixer > [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning postcss-cssnext > caniuse-api > [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning postcss-cssnext > pixrem > [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > [email protected]" has unmet peer dependency "caniuse-lite@^1.0.30000697".
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 66 new dependencies.
info Direct dependencies
└─ [email protected]
info All dependencies
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
└─ [email protected]
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 0 new dependencies.
    √ should automatically install postcss plugins with npm if needed (9546ms)
    √ should automatically install postcss plugins with yarn if needed (518ms)

  customErrors
    √ should include port in server errors
    √ should handle known server errors
    √ should handled unknown server errors

  encodedURI
    √ should support bundling files which names in encoded URI (44ms)

  FSCache
    √ should create directory on ensureDirExists (84ms)
    √ should cache resources (60ms)
    √ should return null for invalidated resources
    √ should remove file on delete (47ms)
    √ should remove from invalidated on write (44ms)
    √ should include mtime for dependencies included in parent (51ms)
    √ should invalidate when dependency included in parent changes (1061ms)
    √ should return null on read error
    √ should continue without throwing on write error
    √ should invalidate cache if a wildcard dependency changes (1056ms)

  fs
    --target=browser
      √ should inline a file as a string (66ms)
      √ should inline a file as a buffer (210ms)
      √ should inline a file with fs require alias (57ms)
      √ should inline a file with fs require inline (57ms)
      √ should inline a file with fs require assignment (61ms)
      √ should inline a file with fs require assignment alias (47ms)
      √ should inline a file with fs require destructure (59ms)
      √ should inline a file with fs require destructure assignment (54ms)
      √ should not evaluate fs calls when package.browser.fs is false (95ms)
      √ should ignore fs calls when the filename is not evaluable (61ms)
      √ should ignore fs calls when the options are not evaluable (66ms)
    --target=node
      √ should leave an attempt to read a file unchanged (45ms)
    --target=electron
      √ should leave an attempt to read a file unchanged (46ms)

  generateCertificate
    √ should support loading cached certificate
    √ should support caching generated certificate (1575ms)

  getCertificate
    √ should support custom certificate

  glob
    √ should require a glob of files (93ms)
    √ should require nested directories with a glob (89ms)
    √ should support importing a glob of CSS files (96ms)

  glsl
    √ should support requiring GLSL files via glslify (153ms)

  graphql
    √ should support requiring graphql files (97ms)
    √ should support importing other graphql files from a graphql file (72ms)

  hmr
    √ should emit an HMR update for the file that changed (882ms)
    √ should not enable HMR for --target=node (499ms)
    √ should enable HMR for --target=electron (756ms)
    √ should emit an HMR update for all new dependencies along with the changed file (1154ms)
    √ should emit an HMR error on bundle failure (943ms)
    √ should emit an HMR error to new connections after a bundle failure (979ms)
    √ should emit an HMR error-resolved on build after error (1038ms)
    √ should accept HMR updates in the runtime (793ms)
    √ should call dispose and accept callbacks (828ms)
    √ should work across bundles (968ms)
    √ should log emitted errors and show an error overlay (1014ms)
    √ should log when errors resolve (1206ms)
    √ should make a secure connection (4954ms)
    √ should make a secure connection with custom certificate (840ms)

  html
    √ should support bundling HTML (185ms)
    √ should find href attr when not first (38ms)
    √ should support transforming HTML with posthtml (43ms)
    √ should find assets inside posthtml (91ms)
    √ should add dependencies referenced by posthtml-include (40ms)
    √ should add dependencies referenced by plugins
    √ should insert sibling CSS bundles for JS files in the HEAD (108ms)
    √ should insert sibling bundles before body element if no HEAD (78ms)
    √ should insert sibling JS bundles for CSS files in the HEAD (199ms)
    √ should insert sibling bundles at correct location in tree when optional elements are absent (139ms)
    √ should minify HTML in production mode (413ms)
    √ should read .htmlnanorc and minify HTML in production mode (1512ms)
    √ should not minify default values inside HTML in production mode
    √ should not prepend the public path to assets with remote URLs (104ms)
    √ should not prepend the public path to hash links (65ms)
    √ should detect virtual paths (46ms)
    √ should not update root/main file in the bundles (128ms)
    √ should conserve the spacing in the HTML tags (139ms)
    √ should support child bundles of different types (150ms)
    √ should support circular dependencies (139ms)
    √ should support bundling HTM (77ms)
    √ should detect srcset attribute (106ms)
    √ should detect srcset attribute of source element (56ms)
    √ should support webmanifest (52ms)
    √ should bundle svg files correctly (46ms)
    √ should support data attribute of object element
    √ should resolve assets containing spaces
    √ should process inline JS (52ms)
    √ should process inline styles (131ms)
    √ should process inline styles using lang (285ms)
    √ should process inline non-js scripts (116ms)
    √ should handle inline css with @imports (103ms)
    √ should error on imports and requires in inline <script> tags

  isURL
    √ should match url
    √ should match anchor
    √ should match scheme-only

  javascript
    √ should produce a basic JS bundle with CommonJS requires (231ms)
    √ should produce a basic JS bundle with ES6 imports (211ms)
    √ should produce a basic JS bundle with object rest spread support (98ms)
    √ should bundle node_modules on --target=browser (63ms)
    √ should not bundle node_modules on --target=node (59ms)
    √ should not bundle node_modules on --target=electron (49ms)
    √ should bundle node_modules on --target=node and --bundle-node-modules (40ms)
    √ should bundle node_modules on --target=electron and --bundle-node-modules (49ms)
    √ should produce a JS bundle with default exports and no imports (48ms)
    √ should split bundles when a dynamic import is used with --target=browser (114ms)
    √ should split bundles when a dynamic import is used with --target=node (100ms)
    √ should support bundling workers (139ms)
    √ should support bundling workers with different order (129ms)
    √ should support bundling service-workers (77ms)
(node:6432) UnhandledPromiseRejectionWarning: AssertionError [ERR_ASSERTION]: expected file does not exist
    at assertBundleTree (C:\Projekte\parcel-fix-path_60c43d7\test\utils.js:246:5)
(node:6432) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:6432) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
    √ should support bundling workers with circular dependencies (67ms)
    √ should dynamic import files which import raw files (138ms)
    √ should return all exports as an object when using ES modules (124ms)
    √ should hoist common dependencies into a parent bundle (190ms)
    √ should not duplicate a module which is already in a parent bundle (110ms)
    √ should support hoisting shared modules with async imports up multiple levels (146ms)
    √ should support requiring JSON files (63ms)
    √ should support requiring JSON5 files (69ms)
    √ should support importing a URL to a raw asset (60ms)
    √ should minify JS in production mode (52ms)
    √ should use uglify config (43ms)
    √ should insert global variables when needed (201ms)
(node:6432) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
    √ should handle re-declaration of the global constant (49ms)
    √ should not insert environment variables on --target=node (43ms)
    √ should not insert environment variables on --target=electron (43ms)
    √ should insert environment variables on --target=browser (49ms)
    √ should insert environment variables from a file (46ms)
    √ should support adding implicit dependencies (63ms)
    √ should support requiring YAML files (96ms)
    √ should support requiring TOML files (64ms)
    √ should support requiring CoffeeScript files (69ms)
    √ should resolve the browser field before main (67ms)
    √ should not resolve the browser field for --target=node (56ms)
    √ should resolve advanced browser resolution (64ms)
    √ should not resolve advanced browser resolution with --target=node (61ms)
    √ should resolve the module field before main (63ms)
    √ should resolve the module field before main (65ms)
    √ should resolve the main field (63ms)
    √ should minify JSON files (43ms)
    √ should minify JSON5 files (42ms)
    √ should minify YAML for production (53ms)
    √ should minify TOML for production (58ms)
    √ should support compiling with babel using .babelrc config (46ms)
    √ should compile with babel with default engines if no config (53ms)
    √ should support compiling with babel using browserlist (38ms)
    √ should support splitting babel-polyfill using browserlist (146ms)
    √ should support compiling with babel using browserslist for different environments (130ms)
    √ should not compile node_modules by default (44ms)
    √ should compile node_modules if legacy browserify options are found (48ms)
    √ should compile node_modules with browserslist to app target
    √ should compile node_modules when symlinked with a source field in package.json (148ms)
    √ should not compile node_modules with a source field in package.json when not symlinked
    √ should support compiling JSX (57ms)
    √ should support compiling JSX in JS files with React dependency (44ms)
    √ should support compiling JSX in JS files with Preact dependency (40ms)
    √ should support compiling JSX in JS files with Nerv dependency (43ms)
    √ should support compiling JSX in JS files with Hyperapp dependency
    √ should support optional dependencies in try...catch blocks (47ms)
    √ should support excluding dependencies in falsy branches (63ms)
    √ should not autoinstall if resolve failed on installed module (42ms)
    √ should not autoinstall if resolve failed on aliased module
    √ should ignore require if it is defined in the scope (54ms)
    √ should expose to CommonJS entry point (49ms)
    √ should expose to RequireJS entry point
    √ should expose variable with --browser-global (45ms)
    √ should set `define` to undefined so AMD checks in UMD modules do not pass (49ms)
    √ should not dedupe imports with different contents (63ms)
    √ should not dedupe imports with same content but different absolute dependency paths (88ms)
    √ should dedupe imports with same content and same dependency paths (65ms)
    √ should support importing HTML from JS async (118ms)
    √ should support importing HTML from JS async with --target=node (118ms)
    √ should support importing HTML from JS sync (105ms)
    √ should strip away flow types of node modules (67ms)
    √ should stub require.cache (42ms)

  less
    √ should support requiring less files (154ms)
    √ should support less imports (63ms)
    √ should support advanced less imports (65ms)
    √ should support requiring empty less files (49ms)
    √ should support linking to assets with url() from less (78ms)
    √ should support transforming less with postcss (157ms)

  line counter
    √ counts number of lines of a string
    √ counts number of lines of a file from disk

  Logger
    √ should log message on write
    √ should track number of lines on persist false
    √ should not track number of lines on persist true
    √ should respect log levels
    √ should handle lack of color support with alternatives
    √ should reset on clear
    √ should use ora for progress
    √ should use internal _log function for writes

  parser
    √ should support case-insensitive file extension (102ms)

  plugins
    √ should load plugins and apply custom asset type (207ms)
    √ should load package.json from parent tree

  prettyError
    √ should handle passing error as string
    √ should handle passing error as object
    √ should handle unknown input
    √ should prepend fileName
    √ should prepend line and column location
    √ should support providing a codeFrame as stack
    √ should support highlightedCodeFrame when opts.color is true
    √ should support stack

  pug
    √ should support bundling HTML (328ms)
    √ should support include and extends files
    √ should support variables (45ms)
    √ should support mixins
    √ should support filters
    √ should minify HTML in production mode

  reason
    √ should produce a bundle (63ms)

  resolver
    file paths
      √ should resolve a relative path with an extension
      √ should resolve a relative path without an extension
      √ should resolve an absolute path from the root module
      √ should resolve an absolute path from a node_modules folder
      √ should resolve a tilde path from the root module
      √ should resolve a tilde path from the root module without a slash
      √ should resolve a tilde path from a node_modules folder
    builtins
      √ should resolve node builtin modules
      √ should resolve unimplemented node builtin modules to an empty file
      √ should error when resolving node builtin modules with --target=node
    node_modules
      √ should resolve a node_modules index.js
      √ should resolve a node_modules package.main
      √ should resolve a node_modules package.module
      √ should resolve a node_modules package.browser main field
      √ should fall back to package.main when package.module does not exist
      √ should not resolve a node_modules package.browser main field with --target=node
      √ should fall back to index.js when it cannot find package.main
      √ should resolve a node_module package.main pointing to a directory
      √ should resolve a file inside a node_modules folder
      √ should resolve a scoped module
      √ should resolve a file inside a scoped module
    aliases
      √ should alias the main file using the package.browser field
      √ should alias a sub-file using the package.browser field
      √ should alias a relative file using the package.browser field
      √ should not alias using the package.browser field with --target=node
      √ should alias a sub-file using the package.alias field
      √ should alias a relative file using the package.alias field
      √ should alias a glob using the package.alias field
      √ should apply a module alias using the package.alias field in the root package
      √ should apply a global module alias using the package.alias field in the root package
      √ should apply a global module alias to a sub-file in a package
      √ should apply a module alias pointing to a file using the package.alias field
      √ should apply a global module alias pointing to a file using the package.alias field
      √ should apply an alias for a virtual module folder (relative to project dir)
      √ should apply an alias for a virtual module folder only (relative to project dir)
      √ should apply an alias for a virtual module folder (relative to root dir)
      √ should apply an alias for a virtual module folder only (relative to root dir)
      √ should apply an alias for a virtual module folder sub-path
      √ should apply an alias for a virtual module folder glob sub-path
      √ should apply an alias for a virtual module
      √ should apply a global alias for a virtual module
      √ should resolve to an empty file when package.browser resolves to false
      √ should resolve to an empty file when package.alias resolves to false
    source field
      √ should use the source field when symlinked
      √ should not use the source field when not symlinked
      √ should use the source field as an alias when symlinked
    √ should serve a 500 response without stack trace when bundler has errors in production (49ms)
    √ should support HTTPS (2690ms)
    √ should support HTTPS via custom certificate (155ms)
    √ should support setting a public url (158ms)
    √ should serve static assets as well as html (125ms)
    √ should work with query parameters that contain a dot (125ms)

  sourcemaps
    √ should create a valid sourcemap as a child of a JS bundle (53ms)
    √ should create a valid sourcemap as a child of a TS bundle (411ms)
    √ should create a valid sourcemap as a child of a nested TS bundle (85ms)
    √ should create a valid sourcemap for a js file with requires (78ms)
    √ should create a valid sourcemap for a minified js bundle with requires (81ms)
    √ should create a valid sourcemap reference for a child bundle (118ms)
    √ should load existing sourcemaps of libraries (65ms)
(node:8296) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
    √ should load inline sourcemaps of libraries (77ms)
    √ should load referenced contents of sourcemaps (50ms)

  stylus
    √ should support requiring stylus files (282ms)
    √ should support requiring stylus files with dependencies (459ms)
    √ should support linking to assets with url() from stylus (90ms)
    √ should support transforming stylus with postcss (83ms)
    √ should support requiring stylus files with glob dependencies (114ms)

  sugarss
    √ should correctly parse SugarSS asset (69ms)

  typescript
    √ should produce a ts bundle using ES6 imports (83ms)
    √ should produce a ts bundle using commonJS require (88ms)
    √ should support json require (74ms)
    √ should support env variables (44ms)
    √ should support importing a URL to a raw asset (68ms)
    √ should minify in production mode (83ms)
    √ should support loading tsconfig.json (60ms)
    √ should support compiling JSX (51ms)
    √ should use esModuleInterop by default (77ms)

  Url Join
    √ should join a filename with a URL
    √ should join a path with a URL
    √ should join a paths together
    √ should join an absolute path with a URL
    √ should join a URL with a querystring
    √ should join a URL with a hash
    √ should join two paths together
    √ should support windows paths
    √ should parse double slashes as host

  vue
    √ should produce a basic vue bundle (404ms)
    √ should produce a vue bundle with dependencies (154ms)
    √ should produce a vue bundle using preprocessors (195ms)
    √ should produce a vue bundle using a functional component (88ms)
    √ should produce a vue bundle using scoped styles (98ms)
    √ should produce a vue bundle using CSS modules (97ms)
    √ should bundle nested components dynamically (198ms)
    √ should produce a basic production vue bundle (101ms)

  wasm
    --target=browser
      √ should preload a wasm file for a sync require (123ms)
      √ should load a wasm file asynchronously with dynamic import (111ms)
      1) should load a wasm file in parallel with a dynamic JS import
    --target=node
      √ should preload a wasm file for a sync require (118ms)
      √ should load a wasm file asynchronously with dynamic import (89ms)
      2) should load a wasm file in parallel with a dynamic JS import

  watcher
    √ should rebuild on file change (726ms)
    √ should re-generate bundle tree when files change (1012ms)
    √ should only re-package bundles that changed (1927ms)
    √ should unload assets that are orphaned (851ms)
    √ should recompile all assets when a config file changes (727ms)
    √ should rebuild if the file behind a symlink changes (801ms)

  WorkerFarm
    √ Should start up workers (376ms)
    √ Should handle 1000 requests without any issue (388ms)
    √ Should consistently initialise workers, even after 100 re-inits (206ms)
    √ Should warm up workers (170ms)
    √ Should use the local worker (139ms)
    √ Should be able to use bi-directional communication (257ms)
    √ Should be able to handle 1000 bi-directional calls (390ms)
    √ Bi-directional call should return masters pid (246ms)
    √ Should handle 10 big concurrent requests without any issue (208ms)


  361 passing (2m)
  2 failing

  1) wasm
       --target=browser
         should load a wasm file in parallel with a dynamic JS import:
     Uncaught evalmachine.<anonymous>:41
        throw err;
        ^

Error: Cannot find module 'add.wasm'
      at newRequire (evalmachine.<anonymous>:39:19)
      at newRequire (evalmachine.<anonymous>:23:18)
      at localRequire (evalmachine.<anonymous>:55:14)
      at Object.parcelRequire.dynamic.js../add.wasm (evalmachine.<anonymous>:108:16)
      at newRequire (evalmachine.<anonymous>:49:24)
      at parcelRequire.dynamic.js../add.wasm (evalmachine.<anonymous>:81:5)
      at evalmachine.<anonymous>:107:3
      at Script.runInContext (vm.js:102:20)
      at Object.runInContext (vm.js:280:6)
      at Timeout._onTimeout (test\utils.js:84:20)

  2) wasm
       --target=node
         should load a wasm file in parallel with a dynamic JS import:
     Error: Cannot find module 'add.wasm'
      at Function.Module._resolveFilename (internal/modules/cjs/loader.js:594:15)
      at Function.Module._load (internal/modules/cjs/loader.js:520:25)
      at Module.require (internal/modules/cjs/loader.js:650:17)
      at require (test\utils.js:152:20)
      at newRequire (evalmachine.<anonymous>:36:18)
      at newRequire (eval at <anonymous> (evalmachine.<anonymous>:253:5), <anonymous>:25:18)
      at localRequire (eval at <anonymous> (evalmachine.<anonymous>:253:5), <anonymous>:57:14)
      at Object.parcelRequire.dynamic.js../add.wasm (eval at <anonymous> (evalmachine.<anonymous>:253:5), <anonymous>:110:16)
      at newRequire (eval at <anonymous> (evalmachine.<anonymous>:253:5), <anonymous>:51:24)
      at parcelRequire.dynamic.js../add.wasm (eval at <anonymous> (evalmachine.<anonymous>:253:5), <anonymous>:83:5)
      at eval (eval at <anonymous> (evalmachine.<anonymous>:253:5), <anonymous>:109:3)
      at evalmachine.<anonymous>:253:27



error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

[wsl / debian 🐧]

Tests (almost) all pass (except for WASM)

wasm
--target=browser
  ✓ should preload a wasm file for a sync require (114ms)
  ✓ should load a wasm file asynchronously with dynamic import (111ms)
  1) should load a wasm file in parallel with a dynamic JS import
--target=node
  ✓ should preload a wasm file for a sync require (82ms)
  ✓ should load a wasm file asynchronously with dynamic import (85ms)
  2) should load a wasm file in parallel with a dynamic JS import
WorkerFarm 
[...]
  ✓ Bi-directional call should return masters pid

after ✓ Bi-directional call should return masters pid tests hang and dont continue (let it work for more than 20 minutes before aborting)

(click) test logs

#### non elevated tests

yarn run v1.9.4
$ cross-env NODE_ENV=test mocha


  Asset
    ✓ should include default implementations
    ✓ should support overriding the filename of the root bundle (2063ms)
    ✓ should have backward compatibility for package field
    addURLDependency
      ✓ should ignore urls
      ✓ should ignore empty string
      ✓ should generate bundle name
      ✓ should preserve query and hash
      ✓ should resolve slash
      ✓ should resolve tilde

  autoinstall
npm + [email protected]
added 1 package from 2 contributors and audited 1 package in 2.347s
notice created a lockfile as package-lock.json. You should commit this file.
found 0 vulnerabilities

    ✓ should install lodash using npm and save dev dependency to package.json (3417ms)
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
└─ [email protected]
info All dependencies
└─ [email protected]
    ✓ should install lodash using yarn and save dev dependency to package.json (1742ms)

  bundler
    ✓ should bundle once before exporting middleware (77ms)
    ✓ should defer bundling if a bundle is pending (163ms)
    ✓ should enforce asset type path to be a string
    ✓ should enforce setup before bundling
    ✓ should support multiple entry points (44ms)
    ✓ should support multiple entry points as a glob (47ms)

  content hashing
    ✓ should update content hash when content changes (2265ms)
    ✓ should update content hash when raw asset changes (114ms)

  css
    ✓ should produce two bundles when importing a CSS file (88ms)
    ✓ should support loading a CSS bundle along side dynamic imports (293ms)
    ✓ should support importing CSS from a CSS file (89ms)
    ✓ should support linking to assets with url() from CSS (70ms)
    ✓ should support linking to assets with url() from CSS in production (105ms)
    ✓ should support transforming with postcss (230ms)
    ✓ should support transforming with postcss twice with the same result (124ms)
    ✓ should minify CSS in production mode (102ms)
info No lockfile found.
[1/4] Resolving packages...
warning [email protected]: 'postcss-cssnext' has been deprecated in favor of 'postcss-preset-env'. Read more at https://moox.io/blog/deprecating-cssnext/
warning postcss-cssnext > autoprefixer > [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning postcss-cssnext > pixrem > [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning postcss-cssnext > caniuse-api > [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > [email protected]" has unmet peer dependency "caniuse-lite@^1.0.30000697".
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 66 new dependencies.
info Direct dependencies
└─ [email protected]
info All dependencies
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
└─ [email protected]
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 0 new dependencies.
    ✓ should automatically install postcss plugins with npm if needed (7458ms)
    ✓ should automatically install postcss plugins with yarn if needed (1369ms)

  customErrors
    ✓ should include port in server errors
    ✓ should handle known server errors
    ✓ should handled unknown server errors

  encodedURI
    ✓ should support bundling files which names in encoded URI (42ms)

  FSCache
    ✓ should create directory on ensureDirExists (105ms)
    ✓ should cache resources (87ms)
    ✓ should return null for invalidated resources
    ✓ should remove file on delete (91ms)
    ✓ should remove from invalidated on write (84ms)
    ✓ should include mtime for dependencies included in parent (90ms)
    ✓ should invalidate when dependency included in parent changes (1092ms)
    ✓ should return null on read error
    ✓ should continue without throwing on write error
    ✓ should invalidate cache if a wildcard dependency changes (1095ms)

  fs
    --target=browser
      ✓ should inline a file as a string (54ms)
      ✓ should inline a file as a buffer (240ms)
      ✓ should inline a file with fs require alias (78ms)
      ✓ should inline a file with fs require inline (43ms)
      ✓ should inline a file with fs require assignment (48ms)
      ✓ should inline a file with fs require assignment alias (51ms)
      ✓ should inline a file with fs require destructure (52ms)
      ✓ should inline a file with fs require destructure assignment (41ms)
      ✓ should not evaluate fs calls when package.browser.fs is false (103ms)
      ✓ should ignore fs calls when the filename is not evaluable (53ms)
      ✓ should ignore fs calls when the options are not evaluable (50ms)
    --target=node
      ✓ should leave an attempt to read a file unchanged
    --target=electron
      ✓ should leave an attempt to read a file unchanged

  generateCertificate
    ✓ should support loading cached certificate
    ✓ should support caching generated certificate (3108ms)

  getCertificate
    ✓ should support custom certificate

  glob
    ✓ should require a glob of files (96ms)
    ✓ should require nested directories with a glob (112ms)
    ✓ should support importing a glob of CSS files (110ms)

  glsl
    ✓ should support requiring GLSL files via glslify (175ms)

  graphql
    ✓ should support requiring graphql files (96ms)
    ✓ should support importing other graphql files from a graphql file (78ms)

  hmr
    ✓ should emit an HMR update for the file that changed (970ms)
    ✓ should not enable HMR for --target=node (723ms)
    ✓ should enable HMR for --target=electron (799ms)
    ✓ should emit an HMR update for all new dependencies along with the changed file (1198ms)
    ✓ should emit an HMR error on bundle failure (1122ms)
    ✓ should emit an HMR error to new connections after a bundle failure (1078ms)
    ✓ should emit an HMR error-resolved on build after error (1224ms)
    ✓ should accept HMR updates in the runtime (795ms)
    ✓ should call dispose and accept callbacks (821ms)
    ✓ should work across bundles (1104ms)
    ✓ should log emitted errors and show an error overlay (1144ms)
    ✓ should log when errors resolve (1258ms)
    ✓ should make a secure connection (3200ms)
    ✓ should make a secure connection with custom certificate (1036ms)

  html
    ✓ should support bundling HTML (249ms)
    ✓ should find href attr when not first
    ✓ should support transforming HTML with posthtml (43ms)
    ✓ should find assets inside posthtml (82ms)
    ✓ should add dependencies referenced by posthtml-include (47ms)
    ✓ should add dependencies referenced by plugins (52ms)
    ✓ should insert sibling CSS bundles for JS files in the HEAD (128ms)
    ✓ should insert sibling bundles before body element if no HEAD (131ms)
    ✓ should insert sibling JS bundles for CSS files in the HEAD (263ms)
    ✓ should insert sibling bundles at correct location in tree when optional elements are absent (126ms)
    ✓ should minify HTML in production mode (783ms)
    ✓ should read .htmlnanorc and minify HTML in production mode (4017ms)
    ✓ should not minify default values inside HTML in production mode (663ms)
    ✓ should not prepend the public path to assets with remote URLs (3045ms)
    ✓ should not prepend the public path to hash links (100ms)
    ✓ should detect virtual paths
    ✓ should not update root/main file in the bundles (127ms)
    ✓ should conserve the spacing in the HTML tags (115ms)
    ✓ should support child bundles of different types (116ms)
    ✓ should support circular dependencies (90ms)
    ✓ should support bundling HTM
    ✓ should detect srcset attribute (70ms)
    ✓ should detect srcset attribute of source element (59ms)
    ✓ should support webmanifest (42ms)
    ✓ should bundle svg files correctly (38ms)
    ✓ should support data attribute of object element
    ✓ should resolve assets containing spaces
    ✓ should process inline JS (53ms)
    ✓ should process inline styles (199ms)
    ✓ should process inline styles using lang (250ms)
    ✓ should process inline non-js scripts (93ms)
    ✓ should handle inline css with @imports (113ms)
    ✓ should error on imports and requires in inline <script> tags (41ms)

  isURL
    ✓ should match url
    ✓ should match anchor
    ✓ should match scheme-only

  javascript
    ✓ should produce a basic JS bundle with CommonJS requires (279ms)
    ✓ should produce a basic JS bundle with ES6 imports (255ms)
    ✓ should produce a basic JS bundle with object rest spread support (45ms)
    ✓ should bundle node_modules on --target=browser (52ms)
    ✓ should not bundle node_modules on --target=node (38ms)
    ✓ should not bundle node_modules on --target=electron (40ms)
    ✓ should bundle node_modules on --target=node and --bundle-node-modules (38ms)
    ✓ should bundle node_modules on --target=electron and --bundle-node-modules (43ms)
    ✓ should produce a JS bundle with default exports and no imports
    ✓ should split bundles when a dynamic import is used with --target=browser (132ms)
    ✓ should split bundles when a dynamic import is used with --target=node (118ms)
    ✓ should support bundling workers (120ms)
    ✓ should support bundling workers with different order (133ms)
    ✓ should support bundling service-workers (95ms)
    ✓ should support bundling workers with circular dependencies (66ms)
    ✓ should dynamic import files which import raw files (148ms)
    ✓ should return all exports as an object when using ES modules (143ms)
    ✓ should hoist common dependencies into a parent bundle (189ms)
    ✓ should not duplicate a module which is already in a parent bundle (149ms)
    ✓ should support hoisting shared modules with async imports up multiple levels (147ms)
    ✓ should support requiring JSON files (53ms)
    ✓ should support requiring JSON5 files (58ms)
    ✓ should support importing a URL to a raw asset (50ms)
    ✓ should minify JS in production mode (55ms)
    ✓ should use uglify config
    ✓ should insert global variables when needed (227ms)
(node:7063) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
    ✓ should handle re-declaration of the global constant
    ✓ should not insert environment variables on --target=node
    ✓ should not insert environment variables on --target=electron
    ✓ should insert environment variables on --target=browser
    ✓ should insert environment variables from a file
    ✓ should support adding implicit dependencies (50ms)
    ✓ should support requiring YAML files (85ms)
    ✓ should support requiring TOML files (56ms)
    ✓ should support requiring CoffeeScript files (68ms)
    ✓ should resolve the browser field before main (55ms)
    ✓ should not resolve the browser field for --target=node (44ms)
    ✓ should resolve advanced browser resolution (67ms)
    ✓ should not resolve advanced browser resolution with --target=node (48ms)
    ✓ should resolve the module field before main (60ms)
    ✓ should resolve the module field before main (63ms)
    ✓ should resolve the main field (57ms)
    ✓ should minify JSON files
    ✓ should minify JSON5 files
    ✓ should minify YAML for production (53ms)
    ✓ should minify TOML for production (56ms)
    ✓ should support compiling with babel using .babelrc config (50ms)
    ✓ should compile with babel with default engines if no config (49ms)
    ✓ should support compiling with babel using browserlist
    ✓ should support splitting babel-polyfill using browserlist (191ms)
    ✓ should support compiling with babel using browserslist for different environments (70ms)
    ✓ should not compile node_modules by default
    ✓ should compile node_modules if legacy browserify options are found
    ✓ should compile node_modules with browserslist to app target
    ✓ should compile node_modules when symlinked with a source field in package.json (68ms)
    ✓ should not compile node_modules with a source field in package.json when not symlinked
    ✓ should support compiling JSX (53ms)
    ✓ should support compiling JSX in JS files with React dependency
    ✓ should support compiling JSX in JS files with Preact dependency
    ✓ should support compiling JSX in JS files with Nerv dependency
    ✓ should support compiling JSX in JS files with Hyperapp dependency
    ✓ should support optional dependencies in try...catch blocks
    ✓ should support excluding dependencies in falsy branches (51ms)
    ✓ should not autoinstall if resolve failed on installed module (44ms)
    ✓ should not autoinstall if resolve failed on aliased module (40ms)
    ✓ should ignore require if it is defined in the scope
    ✓ should expose to CommonJS entry point
    ✓ should expose to RequireJS entry point (40ms)
    ✓ should expose variable with --browser-global
    ✓ should set `define` to undefined so AMD checks in UMD modules do not pass
    ✓ should not dedupe imports with different contents (85ms)
    ✓ should not dedupe imports with same content but different absolute dependency paths (90ms)
    ✓ should dedupe imports with same content and same dependency paths (64ms)
    ✓ should support importing HTML from JS async (119ms)
    ✓ should support importing HTML from JS async with --target=node (107ms)
    ✓ should support importing HTML from JS sync (144ms)
    ✓ should strip away flow types of node modules (59ms)
    ✓ should stub require.cache

  less
    ✓ should support requiring less files (205ms)
    ✓ should support less imports (70ms)
    ✓ should support advanced less imports (54ms)
    ✓ should support requiring empty less files (44ms)
    ✓ should support linking to assets with url() from less (82ms)
    ✓ should support transforming less with postcss (216ms)

  line counter
    ✓ counts number of lines of a string
    ✓ counts number of lines of a file from disk

  Logger
    ✓ should log message on write
    ✓ should track number of lines on persist false
    ✓ should not track number of lines on persist true
    ✓ should respect log levels
    ✓ should handle lack of color support with alternatives
    ✓ should reset on clear
    ✓ should use ora for progress
    ✓ should use internal _log function for writes

  parser
    ✓ should support case-insensitive file extension (75ms)

  plugins
    ✓ should load plugins and apply custom asset type (209ms)
    ✓ should load package.json from parent tree

  prettyError
    ✓ should handle passing error as string
    ✓ should handle passing error as object
    ✓ should handle unknown input
    ✓ should prepend fileName
    ✓ should prepend line and column location
    ✓ should support providing a codeFrame as stack
    ✓ should support highlightedCodeFrame when opts.color is true
    ✓ should support stack

  pug
    ✓ should support bundling HTML (402ms)
    ✓ should support include and extends files
    ✓ should support variables (41ms)
    ✓ should support mixins
    ✓ should support filters
    ✓ should minify HTML in production mode (61ms)

  reason
    ✓ should produce a bundle (60ms)

  resolver
    file paths
      ✓ should resolve a relative path with an extension
      ✓ should resolve a relative path without an extension
      ✓ should resolve an absolute path from the root module
      ✓ should resolve an absolute path from a node_modules folder
      ✓ should resolve a tilde path from the root module
      ✓ should resolve a tilde path from the root module without a slash
      ✓ should resolve a tilde path from a node_modules folder
    builtins
      ✓ should resolve node builtin modules
      ✓ should resolve unimplemented node builtin modules to an empty file
      ✓ should error when resolving node builtin modules with --target=node
    node_modules
      ✓ should resolve a node_modules index.js
      ✓ should resolve a node_modules package.main
      ✓ should resolve a node_modules package.module
      ✓ should resolve a node_modules package.browser main field
      ✓ should fall back to package.main when package.module does not exist
      ✓ should not resolve a node_modules package.browser main field with --target=node
      ✓ should fall back to index.js when it cannot find package.main
      ✓ should resolve a node_module package.main pointing to a directory
      ✓ should resolve a file inside a node_modules folder
      ✓ should resolve a scoped module
      ✓ should resolve a file inside a scoped module
    aliases
      ✓ should alias the main file using the package.browser field
      ✓ should alias a sub-file using the package.browser field
      ✓ should alias a relative file using the package.browser field
      ✓ should not alias using the package.browser field with --target=node
      ✓ should alias a sub-file using the package.alias field
      ✓ should alias a relative file using the package.alias field
      ✓ should alias a glob using the package.alias field
      ✓ should apply a module alias using the package.alias field in the root package
      ✓ should apply a global module alias using the package.alias field in the root package
      ✓ should apply a global module alias to a sub-file in a package
      ✓ should apply a module alias pointing to a file using the package.alias field
      ✓ should apply a global module alias pointing to a file using the package.alias field
      ✓ should apply an alias for a virtual module folder (relative to project dir)
      ✓ should apply an alias for a virtual module folder only (relative to project dir)
      ✓ should apply an alias for a virtual module folder (relative to root dir)
      ✓ should apply an alias for a virtual module folder only (relative to root dir)
      ✓ should apply an alias for a virtual module folder sub-path
      ✓ should apply an alias for a virtual module folder glob sub-path
      ✓ should apply an alias for a virtual module
      ✓ should apply a global alias for a virtual module
      ✓ should resolve to an empty file when package.browser resolves to false
      ✓ should resolve to an empty file when package.alias resolves to false
    source field
      ✓ should use the source field when symlinked
      ✓ should not use the source field when not symlinked
      ✓ should use the source field as an alias when symlinked
      ✓ should use the source field as a glob alias when symlinked
    error handling
      ✓ should throw when a relative path cannot be resolved
      ✓ should throw when a node_module cannot be resolved
      ✓ should throw when a subfile of a node_module cannot be resolved

  rust
    ✓ should generate a wasm file from a rust file with rustc with --target=browser (904ms)
    ✓ should generate a wasm file from a rust file with rustc with --target=node (575ms)
    ✓ should support rust files with dependencies via rustc (494ms)
    ✓ should generate a wasm file from a rust file with cargo (237ms)
    ✓ should generate a wasm file from a rust file in cargo workspace (300ms)
    Updating git repository `https://github.com/alexcrichton/wasm-gc`
  Installing wasm-gc v0.1.6 (https://github.com/alexcrichton/wasm-gc#114df2f6)
   Compiling quick-error v1.2.2
   Compiling libc v0.2.43
   Compiling cfg-if v0.1.5
   Compiling byteorder v1.2.6
   Compiling unicode-width v0.1.5
   Compiling termcolor v1.0.2
   Compiling rustc-demangle v0.1.9
   Compiling log v0.4.4
   Compiling humantime v1.1.1
   Compiling getopts v0.2.18
   Compiling parity-wasm v0.32.0
   Compiling atty v0.2.11
   Compiling env_logger v0.5.13
   Compiling wasm-gc-api v0.1.11 (https://github.com/alexcrichton/wasm-gc#114df2f6)
   Compiling wasm-gc v0.1.6 (https://github.com/alexcrichton/wasm-gc#114df2f6)
error: linker `cc` not found
  |
  = note: No such file or directory (os error 2)

error: aborting due to previous error

error: failed to compile `wasm-gc v0.1.6 (https://github.com/alexcrichton/wasm-gc#114df2f6)`, intermediate artifacts can be found at `/tmp/cargo-installTuCHZP`

Caused by:
  Could not compile `wasm-gc`.

To learn more, run the command again with --verbose.
    1) should use wasm-gc to minify output

  sass
    ✓ should support requiring sass files (97ms)
    ✓ should support requiring scss files (82ms)
    ✓ should support scss imports (101ms)
    ✓ should support requiring empty scss files (47ms)
    ✓ should support linking to assets with url() from scss (149ms)
    ✓ should support transforming scss with postcss (81ms)
    ✓ should support advanced import syntax (626ms)

  scope hoisting
    es6
      ✓ supports default imports and exports of expressions (115ms)
      ✓ supports default imports and exports of declarations (85ms)
      ✓ supports default imports and exports of anonymous declarations (81ms)
      ✓ supports default imports and exports of variables (80ms)
      ✓ supports named imports and exports of declarations (80ms)
      ✓ supports named imports and exports of variables (81ms)
      ✓ supports renaming imports (79ms)
      ✓ supports renaming exports (77ms)
      ✓ supports importing a namespace of exported values (82ms)
      ✓ supports re-exporting all exports from another module (127ms)
      ✓ supports re-exporting all exports from multiple modules (181ms)
      ✓ supports importing all exports re-exported from multiple modules deep (138ms)
      ✓ supports re-exporting all exports from multiple modules deep (156ms)
      ✓ supports re-exporting individual named exports from another module (116ms)
      ✓ supports re-exporting default exports from another module (111ms)
      ✓ supports re-exporting a namespace from another module (111ms)
      ✓ excludes default when re-exporting a module (103ms)
      ✓ supports multiple exports of the same variable (86ms)
      ✓ supports live bindings of named exports (83ms)
      ✓ supports dynamic import syntax for code splitting (240ms)
      ✓ should not export function arguments (73ms)
      ✓ supports import default CommonJS interop (100ms)
      ✓ supports import default CommonJS interop with dynamic imports (237ms)
      ✓ supports exporting an import (113ms)
      ✓ keeps side effects by default (98ms)
      ✓ supports the package.json sideEffects: false flag (99ms)
      ✓ supports wildcards with sideEffects: false (105ms)
      ✓ supports the package.json sideEffects flag with an array (114ms)
      ✓ missing exports should be replaced with an empty object (71ms)
      ✓ supports importing a namespace from a commonjs module when code split (188ms)
      ✓ removes unused exports (68ms)
      ✓ support exporting a ES6 module exported as CommonJS (132ms)
      ✓ should support named imports on wrapped modules (84ms)
      ✓ should not nameclash with internal variables (82ms)
    commonjs
      ✓ supports require of commonjs modules (71ms)
      ✓ supports default imports of commonjs modules (70ms)
      ✓ supports named imports of commonjs modules (79ms)
      ✓ supports namespace imports of commonjs modules (85ms)
      ✓ supports require of es6 default export of expressions (71ms)
      ✓ supports require of es6 default export of declarations (68ms)
      ✓ supports require of es6 default export of variables (69ms)
      ✓ supports require of es6 named export of declarations (70ms)
      ✓ supports require of es6 named export of variables (69ms)
      ✓ supports require of es6 renamed exports (75ms)
      ✓ supports require of es6 module re-exporting all exports from another module (108ms)
      ✓ supports require of es6 module re-exporting all exports from multiple modules (132ms)
      ✓ supports re-exporting individual named exports from another module (110ms)
      ✓ supports re-exporting default exports from another module (106ms)
      ✓ supports re-exporting a namespace from another module (101ms)
      ✓ excludes default when re-exporting a module (96ms)
      ✓ supports hybrid ES6 + commonjs modules (71ms)
      ✓ inserts commonjs exports object in the right place (72ms)
      ✓ define exports in the outermost scope (46ms)
      ✓ supports live bindings of named exports (71ms)
      ✓ should wrap modules that use eval in a function (71ms)
      ✓ should wrap modules that have a top-level return (68ms)
    ✓ should serve a 500 response without stack trace when bundler has errors in production (47ms)
    ✓ should support HTTPS (2773ms)
    ✓ should support HTTPS via custom certificate (166ms)
    ✓ should support setting a public url (146ms)
    ✓ should serve static assets as well as html (112ms)
    ✓ should work with query parameters that contain a dot (115ms)

  sourcemaps
    ✓ should create a valid sourcemap as a child of a JS bundle
    ✓ should create a valid sourcemap as a child of a TS bundle (269ms)
    ✓ should create a valid sourcemap as a child of a nested TS bundle (74ms)
    ✓ should create a valid sourcemap for a js file with requires (69ms)
    ✓ should create a valid sourcemap for a minified js bundle with requires (79ms)
    ✓ should create a valid sourcemap reference for a child bundle (109ms)
    ✓ should load existing sourcemaps of libraries (54ms)
(node:7622) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
    ✓ should load inline sourcemaps of libraries (53ms)
    ✓ should load referenced contents of sourcemaps (48ms)

  stylus
    ✓ should support requiring stylus files (317ms)
    ✓ should support requiring stylus files with dependencies (386ms)
    ✓ should support linking to assets with url() from stylus (105ms)
    ✓ should support transforming stylus with postcss (92ms)
    ✓ should support requiring stylus files with glob dependencies (183ms)

  sugarss
    ✓ should correctly parse SugarSS asset (71ms)

  typescript
    ✓ should produce a ts bundle using ES6 imports (89ms)
    ✓ should produce a ts bundle using commonJS require (71ms)
    ✓ should support json require (60ms)
    ✓ should support env variables
    ✓ should support importing a URL to a raw asset (51ms)
    ✓ should minify in production mode (71ms)
    ✓ should support loading tsconfig.json
    ✓ should support compiling JSX (38ms)
    ✓ should use esModuleInterop by default (62ms)

  Url Join
    ✓ should join a filename with a URL
    ✓ should join a path with a URL
    ✓ should join a paths together
    ✓ should join an absolute path with a URL
    ✓ should join a URL with a querystring
    ✓ should join a URL with a hash
    ✓ should join two paths together
    ✓ should support windows paths
    ✓ should parse double slashes as host

  vue
    ✓ should produce a basic vue bundle (323ms)
    ✓ should produce a vue bundle with dependencies (151ms)
    ✓ should produce a vue bundle using preprocessors (245ms)
    ✓ should produce a vue bundle using a functional component (90ms)
    ✓ should produce a vue bundle using scoped styles (88ms)
    ✓ should produce a vue bundle using CSS modules (98ms)
    ✓ should bundle nested components dynamically (258ms)
    ✓ should produce a basic production vue bundle (96ms)

  wasm
    --target=browser
      ✓ should preload a wasm file for a sync require (113ms)
      ✓ should load a wasm file asynchronously with dynamic import (115ms)
      2) should load a wasm file in parallel with a dynamic JS import
    --target=node
      ✓ should preload a wasm file for a sync require (97ms)
      ✓ should load a wasm file asynchronously with dynamic import (86ms)
      3) should load a wasm file in parallel with a dynamic JS import

  watcher
    ✓ should rebuild on file change (877ms)
    ✓ should re-generate bundle tree when files change (1230ms)
    ✓ should only re-package bundles that changed (2354ms)
    ✓ should unload assets that are orphaned (1310ms)
    ✓ should recompile all assets when a config file changes (1294ms)
    ✓ should rebuild if the file behind a symlink changes (1097ms)

  WorkerFarm
    ✓ Should start up workers (374ms)
    ✓ Should handle 1000 requests without any issue (344ms)
    ✓ Should consistently initialise workers, even after 100 re-inits (368ms)
    ✓ Should warm up workers (332ms)
    ✓ Should use the local worker (250ms)
    ✓ Should be able to use bi-directional communication (426ms)
    ✓ Should be able to handle 1000 bi-directional calls (708ms)
    ✓ Bi-directional call should return masters pid (427ms)
^C

I tested this on my own machine with the following specs:

environment

OS PM Node
Microsoft Windows [Version 10.0.17134.254] Yarn v1.9.4 NodeJS v10.4.0
(WSL) Debian 9.3 Yarn v1.9.4 NodeJS v10.4.0

@@ -3,7 +3,6 @@ environment:
matrix:
- nodejs_version: "6"
- nodejs_version: "8"
- nodejs_version: "10"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why don't we test on nodejs 10 ?

Copy link
Member Author

@DeMoorJasper DeMoorJasper Sep 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it takes too long to run all platforms and node 10 should generally work if node 8 works.

Travis is fine, cuz it runs the builds in parallel, AppVeyor runs one platform after another taking ages to finish.

Besides node specific issues should be caught by Travis anyways, Appveyor is just to catch windows errors which should be the same on pretty much every node version (unless there is a bug inside node or some native package we use (which we try to avoid))

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, that makes sense. Hopefully, there won't rise any node-specific windows errors like that edge case.

@DeMoorJasper
Copy link
Member Author

DeMoorJasper commented Sep 12, 2018

@peanutbother Symlinks issue on windows is due to bad privilege handling from windows, not much we can do about bad os design. AppVeyor luckily already runs using proper priviliges for symlinks, so I don't see it as an issue.
It was more difficult to get symlinks to work on windows before I changed it into creating symlinks using node.js. (as git symlinks are pretty complex to get working and require additional config to get them to apply on windows)

WASM is just instable, probably due to it using nightly builds for some reason, don't have any experience with it. So probably someone else should look into this.
In theory we could make the tests optional, but I don't think it's a good idea.

Not sure why workerfarm would take so long, never seen it happen. There might be an issue though, sometimes the bundler doesn't get properly destroyed at the end of a test. (Mainly the dev/watch tests)

@devongovett devongovett merged commit a769fa7 into master Sep 22, 2018
devongovett pushed a commit that referenced this pull request Oct 15, 2018
devongovett pushed a commit that referenced this pull request Oct 15, 2018
@DeMoorJasper DeMoorJasper deleted the fix/windows-tests branch October 9, 2019 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants