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

refactor: Use async/await in core & rollup perf #465

Merged
merged 12 commits into from Aug 9, 2018

Conversation

Projects
None yet
2 participants
@tivac
Copy link
Owner

commented Aug 9, 2018

Simplifying core processor.js logic by using async/await.

Also reworked rollup plugin to be better-behaved during watch runs. Now tracking which files have already been changed per run to avoid excessive churn of processor.delete/processor.file that was causing some race conditions & cache stampedes.

Also threw in some package updates for funsies because hey, why not.

@tivac tivac self-assigned this Aug 9, 2018

@codecov

This comment has been minimized.

Copy link

commented Aug 9, 2018

Codecov Report

Merging #465 into master will decrease coverage by 0.1%.
The diff coverage is 98.18%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #465      +/-   ##
==========================================
- Coverage   99.02%   98.91%   -0.11%     
==========================================
  Files          31       31              
  Lines         819      831      +12     
  Branches      131      134       +3     
==========================================
+ Hits          811      822      +11     
- Misses          8        9       +1
Impacted Files Coverage Δ
packages/core/processor.js 100% <100%> (ø) ⬆️
packages/rollup/rollup.js 97.95% <94.73%> (-0.97%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3824f41...376c59f. Read the comment docs.

tivac added some commits Aug 6, 2018

refactor: safer removal of changed dependencies
Instead of blindly removing all dependencies of the changed file (including all of *their* dependents) now the code will check the dependencies first and only remove ones that actually changed. This speeds things up some and also solves a few issues we were seeing with files that were both in dependency chains AND used directly by another JS file.

I'll try to write a test for that later, it won't be simple.
test: remove timeouts
Instead change files on disk after the first build completes

@tivac tivac force-pushed the async-await branch from df085db to 2337b5b Aug 9, 2018

@TravisBuddy

This comment has been minimized.

Copy link

commented Aug 9, 2018

Travis tests have failed

Hey @tivac,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

Node.js: 8

npm test -- --verbose --ci
> modular-css-root@0.0.0 pretest /home/travis/build/tivac/modular-css
> npm run parser


> modular-css-root@0.0.0 parser /home/travis/build/tivac/modular-css
> pegjs packages/core/parsers/parser.pegjs


> modular-css-root@0.0.0 test /home/travis/build/tivac/modular-css
> jest "--verbose" "--ci"

PASS packages/core/test/options.test.js
  /processor.js
    options
      cwd
        ✓ should use an absolute path (477ms)
        ✓ should accept a relative path but make it absolute (3ms)
      namer
        ✓ should use a custom naming function (5ms)
        ✓ should require a namer if a string is passed (24ms)
        ✓ should use the default naming function if a non-function is passed (2ms)
      map
        ✓ should generate source maps (26ms)
        ✓ should generate external source maps (15ms)
      exportGlobals
        ✓ should not export :global values when exportGlobals is false (3ms)
      rewrite
        ✓ should rewrite url() references by default (5ms)
        ✓ should not rewrite url() references when falsey (2ms)
        ✓ should pass through to postcss-url as config (21ms)
      lifecycle options
        before
          ✓ should run sync postcss plugins before processing (2ms)
          ✓ should run async postcss plugins before processing (57ms)
        processing
          ✓ should run sync postcss plugins processing processing (9ms)
          ✓ should run async postcss plugins processing processing (3ms)
          ✓ should include exports from 'modular-css-export' modules (1ms)
        after
          ✓ should use postcss-url by default (3ms)
          ✓ should run sync postcss plugins (3ms)
          ✓ should run async postcss plugins (3ms)
        done
          ✓ should run sync postcss plugins done processing (1ms)
          ✓ should run async postcss plugins done processing (3ms)
          ✓ should work with cssnano (no preset) (1173ms)
          ✓ should work with cssnano (default preset) (13ms)

PASS packages/rollup/test/rollup.test.js
  /rollup.js
    ✓ should be a function (2ms)
    ✓ should generate exports (74ms)
    ✓ should be able to tree-shake results (9ms)
    ✓ should generate CSS (109ms)
    ✓ should handle assetFileNames being undefined (9ms)
    ✓ should correctly pass to/from params for relative paths (5ms)
    ✓ should avoid generating empty CSS (3ms)
    ✓ should generate JSON (10ms)
    ✓ should provide named exports (7ms)
    ✓ should provide style export (4ms)
    ✓ should warn that styleExport and done aren't compatible (4ms)
    ✓ should generate external source maps (7ms)
    ✓ should warn & not export individual keys when they are not valid identifiers (9ms)
    ✓ should allow disabling of named exports (6ms)
    ✓ shouldn't disable sourcemap generation (7ms)
    ✓ should not output sourcemaps when they are disabled (5ms)
    ✓ should respect the CSS dependency tree (8ms)
    ✓ should accept an existing processor instance (6ms)
    ✓ shouldn't over-remove files from an existing processor instance (13ms)
    errors
      ✓ should throw errors in in before plugins (3ms)
      ✓ should throw errors in after plugins (3ms)
      ○ skipped 1 test

FAIL packages/rollup/test/watch.test.js (15.833s)
  /rollup.js
    watch mode
      ✓ should generate updated output (259ms)
      ✕ should generate updated output for composes changes (5025ms)
      ✓ should update when a dependency changes (295ms)
      ✕ should update when adding new css files (5003ms)
      ✕ should update when a shared dependency changes (5003ms)
      ○ skipped 1 test

  ● /rollup.js › watch mode › should generate updated output for composes changes

    Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.

      73 |         });
      74 | 
    > 75 |         it("should generate updated output for composes changes", (done) => {
         |         ^
      76 |             // Create v1 of the files
      77 |             write(`./watch/change-composes/watched.css`, dedent(`
      78 |                 .one {

      at Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:85:20)
      at Suite.describe (packages/rollup/test/watch.test.js:75:9)
      at Suite.Object.<anonymous>.describe (packages/rollup/test/watch.test.js:20:5)
      at Object.<anonymous> (packages/rollup/test/watch.test.js:19:1)

  ● /rollup.js › watch mode › should update when adding new css files

    Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.

      204 |         });
      205 | 
    > 206 |         it("should update when adding new css files", (done) => {
          |         ^
      207 |             // Create v1 of the files
      208 |             write(`./watch/new-file/one.css`, dedent(`
      209 |                 .one {

      at Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:85:20)
      at Suite.describe (packages/rollup/test/watch.test.js:206:9)
      at Suite.Object.<anonymous>.describe (packages/rollup/test/watch.test.js:20:5)
      at Object.<anonymous> (packages/rollup/test/watch.test.js:19:1)

  ● /rollup.js › watch mode › should update when a shared dependency changes

    Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.

      251 |         });
      252 | 
    > 253 |         it("should update when a shared dependency changes", (done) => {
          |         ^
      254 |             // Create v1 of the files
      255 |             write(`./watch/shared-deps/one.css`, dedent(`
      256 |                 .one {

      at Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:85:20)
      at Suite.describe (packages/rollup/test/watch.test.js:253:9)
      at Suite.Object.<anonymous>.describe (packages/rollup/test/watch.test.js:20:5)
      at Object.<anonymous> (packages/rollup/test/watch.test.js:19:1)

PASS packages/core/test/api.test.js
  /processor.js
    API
      ✓ should be a function (17ms)
      ✓ should auto-instantiate if called without new (1ms)
      .string()
        ✓ should process a string (4ms)
      .file()
        ✓ should process a relative file (3ms)
        ✓ should process an absolute file (2ms)
      .remove()
        ✓ should remove a relative file (1ms)
        ✓ should remove an absolute file (1ms)
        ✓ should remove multiple files (2ms)
        ✓ should return an array of removed files (1ms)
      .dependencies()
        ✓ should return the dependencies of the specified file (11ms)
        ✓ should return the overall order of dependencies if no file is specified (8ms)
      .dependents()
        ✓ should return the dependents of the specified file (7ms)
        ✓ should throw if no file is passed (8ms)
      .output()
        ✓ should return a postcss result (20ms)
        ✓ should generate css representing the output from all added files (11ms)
        ✓ should avoid duplicating files in the output (9ms)
        ✓ should generate a JSON structure of all the compositions (9ms)
        ✓ should order output by dependencies, then alphabetically (15ms)
        ✓ should support returning output for specified relative files (9ms)
        ✓ should support returning output for specified absolute files (9ms)
        ✓ should reject if called before input has been processed (5ms)
        ✓ should allow for seperate source map output (15ms)
      ._resolve()
        ✓ should run resolvers until a match is found (2ms)
        ✓ should fall back to a default resolver (2ms)

(node:5243) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
PASS packages/webpack/test/webpack.test.js
  /webpack.js
    ✓ should be a function (3ms)
    ✓ should output css to disk (277ms)
    ✓ should output json to disk (42ms)
    ✓ should output inline source maps (21ms)
    ✓ should output external source maps to disk (28ms)
    ✓ should report errors (55ms)
    ✓ should report warnings on invalid property names (27ms)
    ✓ should handle dependencies (51ms)
    ✓ should support ES2015 default exports (20ms)
    ✓ should support ES2015 named exports (19ms)
    ✓ should support disabling namedExports when the option is set (26ms)
    ✓ should generate correct builds in watch mode when files change (348ms)
    ✓ should generate correct builds when files change (50ms)

PASS packages/browserify/test/factor-bundle.test.js
  /browserify.js
    factor-bundle
      ✓ should be supported (355ms)
      ✓ should support files w/o commonalities (48ms)
      ✓ should properly handle files w/o dependencies (57ms)
      ✓ should support relative paths within factor-bundle files (66ms)
      ✓ should avoid outputting empty css files by default (56ms)
      ✓ should output empty css files when asked (59ms)

PASS packages/browserify/test/browserify.test.js
  /browserify.js
    basic functionality
      ✓ should not error if no options are supplied (29ms)
      ✓ should error if an invalid extension is applied (3ms)
      ✓ should error on invalid CSS (58ms)
      ✓ should replace require() calls with the exported identifiers (37ms)
      ✓ should correctly rewrite urls based on the destination file (35ms)
      ✓ should use the specified namer function (36ms)
      ✓ should include all CSS dependencies in output css (46ms)
      ✓ should write out the complete exported identifiers when `json` is specified (37ms)
      ✓ should not include duplicate files in the output multiple times (54ms)
      ✓ should output an inline source map when the debug option is specified (47ms)
      ✓ should output an external source map when the debug option is specified (45ms)

PASS packages/svelte/test/svelte.test.js
  /svelte.js
    ✓ should extract CSS from a <style> tag (56ms)
    ✓ should extract CSS from a <link> tag ("no script") (15ms)
    ✓ should extract CSS from a <link> tag ("existing script") (9ms)
    ✓ should extract CSS from a <link> tag ("single quotes") (17ms)
    ✓ should extract CSS from a <link> tag ("unquoted") (13ms)
    ✓ should ignore files without <style> blocks (6ms)
    ✓ should handle invalid references in "<script>" (inline: true, strict: true) (2ms)
    ✓ should handle invalid references in "template" (inline: true, strict: true) (2ms)
    ✓ should handle invalid references in "<script>" (inline: true, strict: false) (5ms)
    ✓ should handle invalid references in "template" (inline: true, strict: false) (2ms)
    ✓ should handle invalid references in "<script>" (inline: false, strict: false) (3ms)
    ✓ should handle invalid references in "template" (inline: false, strict: false) (2ms)
    ✓ should handle invalid references in "<script>" (inline: false, strict: true) (1ms)
    ✓ should handle invalid references in "template" (inline: false, strict: true) (2ms)
    ✓ should throw on both <style> and <link> in one file (1ms)
    ✓ should remove files before reprocessing in case they changed (7ms)

PASS packages/rollup/test/splitting.test.js
  /rollup.js
    code splitting
      ✓ should support splitting up CSS files (37ms)
      ✓ should support splitting up CSS files w/ shared assets (20ms)
      ✓ should support manual chunks (17ms)
      ✓ should support dynamic imports (19ms)

PASS packages/core/test/composition.test.js
  /processor.js
    composition
      ✓ should fail on invalid composes syntax (59ms)
      ✓ should fail if a composition references a non-existant class (5ms)
      ✓ should fail if a composition references a non-existant file (2ms)
      ✓ should fail if composes isn't the first property (3ms)
      ✓ should fail on rules that use multiple selectors (3ms)
      ✓ should compose a single class (3ms)
      ✓ should allow comments before composes (3ms)
      ✓ should compose from globals (2ms)
      ✓ should compose multiple classes (2ms)
      ✓ should compose from other files (6ms)

PASS packages/browserify/test/watchify.test.js
  /browserify.js
    watchify
      ✓ shouldn't cache file contents between watchify runs (241ms)
      ✓ shouldn't explode on invalid CSS (194ms)

PASS packages/postcss/test/postcss.test.js
  /postcss.js
    ✓ should be a function (2ms)
    ✓ should process CSS and output the result (34ms)
    ✓ should process CSS with dependencies and output the result (14ms)
    ✓ should process CSS and output exports as a message (2ms)
    ✓ should accept normal processor options (5ms)
    ✓ should accept a `json` property and write exports to that file (17ms)
    ✓ should use output filepath for json if a custom path isn't provided (9ms)
    ✓ should be usable like a normal postcss plugin (2ms)
    ✓ should output json when used within postcss (1ms)
    ✓ should accept json args in either position with postcss (2ms)

PASS packages/core/test/values.test.js
  /processor.js
    values
      ✓ should fail on invalid value syntax (65ms)
      ✓ should fail if a value imports a non-existant reference (3ms)
      ✓ should support simple values (3ms)
      ✓ should support local values in value composition (9ms)
      ✓ should support importing variables from a file (5ms)
      ✓ should support exporting imported variables (8ms)
      ✓ should support value composition (4ms)
      ✓ should support value namespaces (4ms)
      ✓ should support value replacement in :external(...) (17ms)

PASS packages/aliases/test/aliases.test.js
  modular-css-aliases
    ✓ should return a falsey value if a file isn't found (2ms)
    ✓ should return the absolute path if a file is found (1ms)
    ✓ should check multiple aliases for files & return the first match (1ms)
    ✓ should be usable as a modular-css resolver (27ms)
    ✓ should fall through to the default resolver (7ms)

PASS packages/core/test/scoping.test.js
  /processor.js
    scoping
      ✓ should scope classes, ids, and keyframes (30ms)
      ✓ should handle pseudo classes correctly (3ms)
      ✓ should not allow :global classes to overlap with local ones (local before global) (40ms)
      ✓ should not allow :global classes to overlap with local ones (global before local) (2ms)
      ✓ should not allow empty :global() selectors (2ms)

PASS packages/core/test/keyframes.test.js
  /processor.js
    scoping
      ✓ should leave unknown animation names alone (21ms)
      ✓ should update scoped animations from the scoping plugin's message (3ms)
      ✓ should update the animation-name property (10ms)
      ✓ should update multiple animations properly (2ms)
      ✓ should update scoped prefixed animations from the scoping plugin's message (2ms)

PASS packages/browserify/test/issue-58.test.js
  /browserify.js
    /issues
      /58
        ✓ should update when CSS dependencies change (221ms)

PASS packages/browserify/test/issue-313.test.js
  /browserify.js
    /issues
      /313
        ✓ should include all dependencies after watchify update (369ms)

PASS packages/cli/test/cli.test.js
  /cli.js
    ✓ should show help with no args (224ms)
    ✓ should default to outputting to stdout (286ms)
    ✓ should support outputting to a file (--out) (285ms)
    ✓ should support outputting compositions to a file (--json) (313ms)
    ✓ should return the correct error code on invalid CSS (319ms)
    ✓ should support disabling url() rewriting (--no-rewrite) (267ms)

PASS packages/paths/test/paths.test.js
  modular-css-paths
    ✓ should return a falsey value if a file isn't found (2ms)
    ✓ should return the absolute path if a file is found
    ✓ should check multiple paths for files & return the first match (1ms)
    ✓ should be usable as a modular-css resolver (37ms)

PASS packages/core/test/externals.test.js
  /processor.js
    externals
      ✓ should fail if not a valid composition reference (60ms)
      ✓ should fail if not referencing another file (5ms)
      ✓ should fail on bad class references (15ms)
      ✓ should support overriding external values (18ms)

PASS packages/namer/test/index.test.js
  modular-css-namer
    ✓ should hash its arguments (10ms)
    ✓ should differ within files (1ms)
    ✓ should re-use selectors for identical inputs
    ✓ should differ between files
    ✓ should wrap as necessary (91ms)

PASS packages/core/test/exports.test.js
  /processor.js
    exports
      ✓ should export an object of arrays containing strings (20ms)
      ✓ should export identifiers and their classes (13ms)

PASS packages/glob/test/glob.test.js
  /glob.js
    ✓ should be a function (2ms)
    ✓ should use a default search (30ms)
    ✓ should find files on disk & output css (6ms)
    ✓ should support exclusion patterns (8ms)

PASS packages/core/test/getters.test.js
  /processor.js
    getters
      .file
        ✓ should return all the files that have been added (37ms)
      .options
        ✓ should return the merged options object (1ms)

PASS packages/core/test/issues/issue-56.test.js
  /issues
    /56
      ✓ should prune rules that only compose, but leave them in the exports (24ms)

PASS packages/core/test/issues/issue-24.test.js
  /issues
    /24
      ✓ should be able to compose using a value (26ms)

PASS packages/core/test/issues/issue-98.test.js
  /issues
    /98
      ✓ should prune rules that only compose, but leave them in the exports (22ms)

PASS packages/core/test/unicode.test.js
  /processor.js
    unicode
      ✓ should support unicode classes & ids (44ms)

PASS packages/core/test/issues/issue-66.test.js
  /issues
    /66
      ✓ should ignore remove calls for unknown files (19ms)

PASS packages/core/test/issues/issue-261.test.js
  /issues
    /261
      ✓ should allow colons in rules that also use :external() (35ms)

Summary of all failing tests
FAIL packages/rollup/test/watch.test.js (15.833s)
  ● /rollup.js › watch mode › should generate updated output for composes changes

    Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.

      73 |         });
      74 | 
    > 75 |         it("should generate updated output for composes changes", (done) => {
         |         ^
      76 |             // Create v1 of the files
      77 |             write(`./watch/change-composes/watched.css`, dedent(`
      78 |                 .one {

      at Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:85:20)
      at Suite.describe (packages/rollup/test/watch.test.js:75:9)
      at Suite.Object.<anonymous>.describe (packages/rollup/test/watch.test.js:20:5)
      at Object.<anonymous> (packages/rollup/test/watch.test.js:19:1)

  ● /rollup.js › watch mode › should update when adding new css files

    Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.

      204 |         });
      205 | 
    > 206 |         it("should update when adding new css files", (done) => {
          |         ^
      207 |             // Create v1 of the files
      208 |             write(`./watch/new-file/one.css`, dedent(`
      209 |                 .one {

      at Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:85:20)
      at Suite.describe (packages/rollup/test/watch.test.js:206:9)
      at Suite.Object.<anonymous>.describe (packages/rollup/test/watch.test.js:20:5)
      at Object.<anonymous> (packages/rollup/test/watch.test.js:19:1)

  ● /rollup.js › watch mode › should update when a shared dependency changes

    Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.

      251 |         });
      252 | 
    > 253 |         it("should update when a shared dependency changes", (done) => {
          |         ^
      254 |             // Create v1 of the files
      255 |             write(`./watch/shared-deps/one.css`, dedent(`
      256 |                 .one {

      at Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:85:20)
      at Suite.describe (packages/rollup/test/watch.test.js:253:9)
      at Suite.Object.<anonymous>.describe (packages/rollup/test/watch.test.js:20:5)
      at Object.<anonymous> (packages/rollup/test/watch.test.js:19:1)


Test Suites: 1 failed, 2 skipped, 30 passed, 31 of 33 total
Tests:       3 failed, 5 skipped, 201 passed, 209 total
Snapshots:   247 passed, 247 total
Time:        31.796s
Ran all test suites.
npm ERR! Test failed.  See above for more details.
@TravisBuddy

This comment has been minimized.

Copy link

commented Aug 9, 2018

Travis tests have failed

Hey @tivac,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

Node.js: 8

npm test -- --verbose --ci
> modular-css-root@0.0.0 pretest /home/travis/build/tivac/modular-css
> npm run parser


> modular-css-root@0.0.0 parser /home/travis/build/tivac/modular-css
> pegjs packages/core/parsers/parser.pegjs


> modular-css-root@0.0.0 test /home/travis/build/tivac/modular-css
> jest "--verbose" "--ci"

PASS packages/core/test/options.test.js
  /processor.js
    options
      cwd
        ✓ should use an absolute path (524ms)
        ✓ should accept a relative path but make it absolute (3ms)
      namer
        ✓ should use a custom naming function (5ms)
        ✓ should require a namer if a string is passed (28ms)
        ✓ should use the default naming function if a non-function is passed (1ms)
      map
        ✓ should generate source maps (29ms)
        ✓ should generate external source maps (15ms)
      exportGlobals
        ✓ should not export :global values when exportGlobals is false (3ms)
      rewrite
        ✓ should rewrite url() references by default (5ms)
        ✓ should not rewrite url() references when falsey (2ms)
        ✓ should pass through to postcss-url as config (24ms)
      lifecycle options
        before
          ✓ should run sync postcss plugins before processing (3ms)
          ✓ should run async postcss plugins before processing (79ms)
        processing
          ✓ should run sync postcss plugins processing processing (2ms)
          ✓ should run async postcss plugins processing processing (3ms)
          ✓ should include exports from 'modular-css-export' modules (1ms)
        after
          ✓ should use postcss-url by default (3ms)
          ✓ should run sync postcss plugins (3ms)
          ✓ should run async postcss plugins (3ms)
        done
          ✓ should run sync postcss plugins done processing (2ms)
          ✓ should run async postcss plugins done processing (3ms)
          ✓ should work with cssnano (no preset) (1251ms)
          ✓ should work with cssnano (default preset) (15ms)

PASS packages/rollup/test/rollup.test.js
  /rollup.js
    ✓ should be a function (1ms)
    ✓ should generate exports (82ms)
    ✓ should be able to tree-shake results (10ms)
    ✓ should generate CSS (130ms)
    ✓ should handle assetFileNames being undefined (10ms)
    ✓ should correctly pass to/from params for relative paths (7ms)
    ✓ should avoid generating empty CSS (3ms)
    ✓ should generate JSON (9ms)
    ✓ should provide named exports (9ms)
    ✓ should provide style export (5ms)
    ✓ should warn that styleExport and done aren't compatible (5ms)
    ✓ should generate external source maps (9ms)
    ✓ should warn & not export individual keys when they are not valid identifiers (10ms)
    ✓ should allow disabling of named exports (7ms)
    ✓ shouldn't disable sourcemap generation (8ms)
    ✓ should not output sourcemaps when they are disabled (6ms)
    ✓ should respect the CSS dependency tree (9ms)
    ✓ should accept an existing processor instance (6ms)
    ✓ shouldn't over-remove files from an existing processor instance (16ms)
    errors
      ✓ should throw errors in in before plugins (3ms)
      ✓ should throw errors in after plugins (3ms)
      ○ skipped 1 test

FAIL packages/rollup/test/watch.test.js (11.051s)
  /rollup.js
    watch mode
      ✓ should generate updated output (262ms)
      ✕ should generate updated output for composes changes (5023ms)
      ✓ should update when a dependency changes (295ms)
      ✕ should update when adding new css files (5003ms)
      ✓ should update when a shared dependency changes (225ms)
      ○ skipped 1 test

  ● /rollup.js › watch mode › should generate updated output for composes changes

    Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.

      73 |         });
      74 | 
    > 75 |         it("should generate updated output for composes changes", (done) => {
         |         ^
      76 |             // Create v1 of the files
      77 |             write(`./watch/change-composes/watched.css`, dedent(`
      78 |                 .one {

      at Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:85:20)
      at Suite.describe (packages/rollup/test/watch.test.js:75:9)
      at Suite.Object.<anonymous>.describe (packages/rollup/test/watch.test.js:20:5)
      at Object.<anonymous> (packages/rollup/test/watch.test.js:19:1)

  ● /rollup.js › watch mode › should update when adding new css files

    Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.

      204 |         });
      205 | 
    > 206 |         it("should update when adding new css files", (done) => {
          |         ^
      207 |             // Create v1 of the files
      208 |             write(`./watch/new-file/one.css`, dedent(`
      209 |                 .one {

      at Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:85:20)
      at Suite.describe (packages/rollup/test/watch.test.js:206:9)
      at Suite.Object.<anonymous>.describe (packages/rollup/test/watch.test.js:20:5)
      at Object.<anonymous> (packages/rollup/test/watch.test.js:19:1)

PASS packages/core/test/api.test.js
  /processor.js
    API
      ✓ should be a function (17ms)
      ✓ should auto-instantiate if called without new (1ms)
      .string()
        ✓ should process a string (3ms)
      .file()
        ✓ should process a relative file (3ms)
        ✓ should process an absolute file (3ms)
      .remove()
        ✓ should remove a relative file (1ms)
        ✓ should remove an absolute file (1ms)
        ✓ should remove multiple files (2ms)
        ✓ should return an array of removed files (2ms)
      .dependencies()
        ✓ should return the dependencies of the specified file (10ms)
        ✓ should return the overall order of dependencies if no file is specified (9ms)
      .dependents()
        ✓ should return the dependents of the specified file (8ms)
        ✓ should throw if no file is passed (18ms)
      .output()
        ✓ should return a postcss result (14ms)
        ✓ should generate css representing the output from all added files (17ms)
        ✓ should avoid duplicating files in the output (10ms)
        ✓ should generate a JSON structure of all the compositions (8ms)
        ✓ should order output by dependencies, then alphabetically (14ms)
        ✓ should support returning output for specified relative files (10ms)
        ✓ should support returning output for specified absolute files (11ms)
        ✓ should reject if called before input has been processed (7ms)
        ✓ should allow for seperate source map output (20ms)
      ._resolve()
        ✓ should run resolvers until a match is found (3ms)
        ✓ should fall back to a default resolver (2ms)

(node:5280) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
PASS packages/webpack/test/webpack.test.js
  /webpack.js
    ✓ should be a function (3ms)
    ✓ should output css to disk (296ms)
    ✓ should output json to disk (42ms)
    ✓ should output inline source maps (26ms)
    ✓ should output external source maps to disk (34ms)
    ✓ should report errors (76ms)
    ✓ should report warnings on invalid property names (30ms)
    ✓ should handle dependencies (47ms)
    ✓ should support ES2015 default exports (24ms)
    ✓ should support ES2015 named exports (20ms)
    ✓ should support disabling namedExports when the option is set (29ms)
    ✓ should generate correct builds in watch mode when files change (365ms)
    ✓ should generate correct builds when files change (48ms)

PASS packages/browserify/test/factor-bundle.test.js
  /browserify.js
    factor-bundle
      ✓ should be supported (383ms)
      ✓ should support files w/o commonalities (51ms)
      ✓ should properly handle files w/o dependencies (60ms)
      ✓ should support relative paths within factor-bundle files (74ms)
      ✓ should avoid outputting empty css files by default (58ms)
      ✓ should output empty css files when asked (63ms)

PASS packages/browserify/test/browserify.test.js
  /browserify.js
    basic functionality
      ✓ should not error if no options are supplied (21ms)
      ✓ should error if an invalid extension is applied (3ms)
      ✓ should error on invalid CSS (56ms)
      ✓ should replace require() calls with the exported identifiers (39ms)
      ✓ should correctly rewrite urls based on the destination file (37ms)
      ✓ should use the specified namer function (40ms)
      ✓ should include all CSS dependencies in output css (48ms)
      ✓ should write out the complete exported identifiers when `json` is specified (39ms)
      ✓ should not include duplicate files in the output multiple times (56ms)
      ✓ should output an inline source map when the debug option is specified (49ms)
      ✓ should output an external source map when the debug option is specified (48ms)

PASS packages/svelte/test/svelte.test.js
  /svelte.js
    ✓ should extract CSS from a <style> tag (55ms)
    ✓ should extract CSS from a <link> tag ("no script") (15ms)
    ✓ should extract CSS from a <link> tag ("existing script") (9ms)
    ✓ should extract CSS from a <link> tag ("single quotes") (18ms)
    ✓ should extract CSS from a <link> tag ("unquoted") (9ms)
    ✓ should ignore files without <style> blocks (5ms)
    ✓ should handle invalid references in "<script>" (inline: true, strict: true) (2ms)
    ✓ should handle invalid references in "template" (inline: true, strict: true) (1ms)
    ✓ should handle invalid references in "<script>" (inline: true, strict: false) (6ms)
    ✓ should handle invalid references in "template" (inline: true, strict: false) (2ms)
    ✓ should handle invalid references in "<script>" (inline: false, strict: false) (2ms)
    ✓ should handle invalid references in "template" (inline: false, strict: false) (2ms)
    ✓ should handle invalid references in "<script>" (inline: false, strict: true) (1ms)
    ✓ should handle invalid references in "template" (inline: false, strict: true) (1ms)
    ✓ should throw on both <style> and <link> in one file (1ms)
    ✓ should remove files before reprocessing in case they changed (4ms)

PASS packages/rollup/test/splitting.test.js
  /rollup.js
    code splitting
      ✓ should support splitting up CSS files (36ms)
      ✓ should support splitting up CSS files w/ shared assets (19ms)
      ✓ should support manual chunks (17ms)
      ✓ should support dynamic imports (18ms)

PASS packages/core/test/composition.test.js
  /processor.js
    composition
      ✓ should fail on invalid composes syntax (56ms)
      ✓ should fail if a composition references a non-existant class (6ms)
      ✓ should fail if a composition references a non-existant file (2ms)
      ✓ should fail if composes isn't the first property (3ms)
      ✓ should fail on rules that use multiple selectors (3ms)
      ✓ should compose a single class (3ms)
      ✓ should allow comments before composes (3ms)
      ✓ should compose from globals (2ms)
      ✓ should compose multiple classes (2ms)
      ✓ should compose from other files (5ms)

PASS packages/browserify/test/watchify.test.js
  /browserify.js
    watchify
      ✓ shouldn't cache file contents between watchify runs (252ms)
      ✓ shouldn't explode on invalid CSS (199ms)

PASS packages/postcss/test/postcss.test.js
  /postcss.js
    ✓ should be a function (2ms)
    ✓ should process CSS and output the result (34ms)
    ✓ should process CSS with dependencies and output the result (14ms)
    ✓ should process CSS and output exports as a message (3ms)
    ✓ should accept normal processor options (5ms)
    ✓ should accept a `json` property and write exports to that file (20ms)
    ✓ should use output filepath for json if a custom path isn't provided (10ms)
    ✓ should be usable like a normal postcss plugin (3ms)
    ✓ should output json when used within postcss (2ms)
    ✓ should accept json args in either position with postcss (1ms)

PASS packages/core/test/values.test.js
  /processor.js
    values
      ✓ should fail on invalid value syntax (68ms)
      ✓ should fail if a value imports a non-existant reference (3ms)
      ✓ should support simple values (4ms)
      ✓ should support local values in value composition (10ms)
      ✓ should support importing variables from a file (5ms)
      ✓ should support exporting imported variables (8ms)
      ✓ should support value composition (5ms)
      ✓ should support value namespaces (5ms)
      ✓ should support value replacement in :external(...) (18ms)

PASS packages/aliases/test/aliases.test.js
  modular-css-aliases
    ✓ should return a falsey value if a file isn't found (2ms)
    ✓ should return the absolute path if a file is found (1ms)
    ✓ should check multiple aliases for files & return the first match (1ms)
    ✓ should be usable as a modular-css resolver (27ms)
    ✓ should fall through to the default resolver (8ms)

PASS packages/core/test/scoping.test.js
  /processor.js
    scoping
      ✓ should scope classes, ids, and keyframes (32ms)
      ✓ should handle pseudo classes correctly (4ms)
      ✓ should not allow :global classes to overlap with local ones (local before global) (42ms)
      ✓ should not allow :global classes to overlap with local ones (global before local) (2ms)
      ✓ should not allow empty :global() selectors (3ms)

PASS packages/core/test/keyframes.test.js
  /processor.js
    scoping
      ✓ should leave unknown animation names alone (21ms)
      ✓ should update scoped animations from the scoping plugin's message (3ms)
      ✓ should update the animation-name property (11ms)
      ✓ should update multiple animations properly (2ms)
      ✓ should update scoped prefixed animations from the scoping plugin's message (2ms)

PASS packages/browserify/test/issue-58.test.js
  /browserify.js
    /issues
      /58
        ✓ should update when CSS dependencies change (225ms)

PASS packages/browserify/test/issue-313.test.js
  /browserify.js
    /issues
      /313
        ✓ should include all dependencies after watchify update (423ms)

PASS packages/cli/test/cli.test.js
  /cli.js
    ✓ should show help with no args (238ms)
    ✓ should default to outputting to stdout (303ms)
    ✓ should support outputting to a file (--out) (316ms)
    ✓ should support outputting compositions to a file (--json) (303ms)
    ✓ should return the correct error code on invalid CSS (301ms)
    ✓ should support disabling url() rewriting (--no-rewrite) (274ms)

PASS packages/paths/test/paths.test.js
  modular-css-paths
    ✓ should return a falsey value if a file isn't found (3ms)
    ✓ should return the absolute path if a file is found (1ms)
    ✓ should check multiple paths for files & return the first match (1ms)
    ✓ should be usable as a modular-css resolver (38ms)

PASS packages/core/test/externals.test.js
  /processor.js
    externals
      ✓ should fail if not a valid composition reference (63ms)
      ✓ should fail if not referencing another file (5ms)
      ✓ should fail on bad class references (16ms)
      ✓ should support overriding external values (21ms)

PASS packages/namer/test/index.test.js
  modular-css-namer
    ✓ should hash its arguments (12ms)
    ✓ should differ within files (1ms)
    ✓ should re-use selectors for identical inputs (1ms)
    ✓ should differ between files (1ms)
    ✓ should wrap as necessary (104ms)

PASS packages/core/test/exports.test.js
  /processor.js
    exports
      ✓ should export an object of arrays containing strings (19ms)
      ✓ should export identifiers and their classes (11ms)

PASS packages/glob/test/glob.test.js
  /glob.js
    ✓ should be a function (1ms)
    ✓ should use a default search (27ms)
    ✓ should find files on disk & output css (5ms)
    ✓ should support exclusion patterns (6ms)

PASS packages/core/test/getters.test.js
  /processor.js
    getters
      .file
        ✓ should return all the files that have been added (35ms)
      .options
        ✓ should return the merged options object (1ms)

PASS packages/core/test/issues/issue-56.test.js
  /issues
    /56
      ✓ should prune rules that only compose, but leave them in the exports (20ms)

PASS packages/core/test/issues/issue-24.test.js
  /issues
    /24
      ✓ should be able to compose using a value (24ms)

PASS packages/core/test/issues/issue-98.test.js
  /issues
    /98
      ✓ should prune rules that only compose, but leave them in the exports (20ms)

PASS packages/core/test/unicode.test.js
  /processor.js
    unicode
      ✓ should support unicode classes & ids (41ms)

PASS packages/core/test/issues/issue-66.test.js
  /issues
    /66
      ✓ should ignore remove calls for unknown files (18ms)

PASS packages/core/test/issues/issue-261.test.js
  /issues
    /261
      ✓ should allow colons in rules that also use :external() (34ms)

Summary of all failing tests
FAIL packages/rollup/test/watch.test.js (11.051s)
  ● /rollup.js › watch mode › should generate updated output for composes changes

    Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.

      73 |         });
      74 | 
    > 75 |         it("should generate updated output for composes changes", (done) => {
         |         ^
      76 |             // Create v1 of the files
      77 |             write(`./watch/change-composes/watched.css`, dedent(`
      78 |                 .one {

      at Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:85:20)
      at Suite.describe (packages/rollup/test/watch.test.js:75:9)
      at Suite.Object.<anonymous>.describe (packages/rollup/test/watch.test.js:20:5)
      at Object.<anonymous> (packages/rollup/test/watch.test.js:19:1)

  ● /rollup.js › watch mode › should update when adding new css files

    Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.

      204 |         });
      205 | 
    > 206 |         it("should update when adding new css files", (done) => {
          |         ^
      207 |             // Create v1 of the files
      208 |             write(`./watch/new-file/one.css`, dedent(`
      209 |                 .one {

      at Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:85:20)
      at Suite.describe (packages/rollup/test/watch.test.js:206:9)
      at Suite.Object.<anonymous>.describe (packages/rollup/test/watch.test.js:20:5)
      at Object.<anonymous> (packages/rollup/test/watch.test.js:19:1)


Test Suites: 1 failed, 2 skipped, 30 passed, 31 of 33 total
Tests:       2 failed, 5 skipped, 202 passed, 209 total
Snapshots:   248 passed, 248 total
Time:        27.541s
Ran all test suites.
npm ERR! Test failed.  See above for more details.
test: add back more delay
But not as much as they previously had.
@TravisBuddy

This comment has been minimized.

Copy link

commented Aug 9, 2018

Travis tests have failed

Hey @tivac,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

Node.js: 8

npm test -- --verbose --ci
> modular-css-root@0.0.0 pretest /home/travis/build/tivac/modular-css
> npm run parser


> modular-css-root@0.0.0 parser /home/travis/build/tivac/modular-css
> pegjs packages/core/parsers/parser.pegjs


> modular-css-root@0.0.0 test /home/travis/build/tivac/modular-css
> jest "--verbose" "--ci"

PASS packages/core/test/options.test.js
  /processor.js
    options
      cwd
        ✓ should use an absolute path (479ms)
        ✓ should accept a relative path but make it absolute (2ms)
      namer
        ✓ should use a custom naming function (4ms)
        ✓ should require a namer if a string is passed (14ms)
        ✓ should use the default naming function if a non-function is passed (1ms)
      map
        ✓ should generate source maps (35ms)
        ✓ should generate external source maps (14ms)
      exportGlobals
        ✓ should not export :global values when exportGlobals is false (3ms)
      rewrite
        ✓ should rewrite url() references by default (5ms)
        ✓ should not rewrite url() references when falsey (2ms)
        ✓ should pass through to postcss-url as config (22ms)
      lifecycle options
        before
          ✓ should run sync postcss plugins before processing (2ms)
          ✓ should run async postcss plugins before processing (56ms)
        processing
          ✓ should run sync postcss plugins processing processing (2ms)
          ✓ should run async postcss plugins processing processing (3ms)
          ✓ should include exports from 'modular-css-export' modules (2ms)
        after
          ✓ should use postcss-url by default (4ms)
          ✓ should run sync postcss plugins (3ms)
          ✓ should run async postcss plugins (3ms)
        done
          ✓ should run sync postcss plugins done processing (2ms)
          ✓ should run async postcss plugins done processing (2ms)
          ✓ should work with cssnano (no preset) (1124ms)
          ✓ should work with cssnano (default preset) (13ms)

PASS packages/rollup/test/rollup.test.js
  /rollup.js
    ✓ should be a function (2ms)
    ✓ should generate exports (79ms)
    ✓ should be able to tree-shake results (9ms)
    ✓ should generate CSS (92ms)
    ✓ should handle assetFileNames being undefined (12ms)
    ✓ should correctly pass to/from params for relative paths (7ms)
    ✓ should avoid generating empty CSS (4ms)
    ✓ should generate JSON (10ms)
    ✓ should provide named exports (8ms)
    ✓ should provide style export (4ms)
    ✓ should warn that styleExport and done aren't compatible (4ms)
    ✓ should generate external source maps (7ms)
    ✓ should warn & not export individual keys when they are not valid identifiers (10ms)
    ✓ should allow disabling of named exports (6ms)
    ✓ shouldn't disable sourcemap generation (7ms)
    ✓ should not output sourcemaps when they are disabled (5ms)
    ✓ should respect the CSS dependency tree (8ms)
    ✓ should accept an existing processor instance (5ms)
    ✓ shouldn't over-remove files from an existing processor instance (14ms)
    errors
      ✓ should throw errors in in before plugins (3ms)
      ✓ should throw errors in after plugins (2ms)
      ○ skipped 1 test

FAIL packages/rollup/test/watch.test.js (15.708s)
  /rollup.js
    watch mode
      ✓ should generate updated output (257ms)
      ✕ should generate updated output for composes changes (5018ms)
      ✓ should update when a dependency changes (224ms)
      ✕ should update when adding new css files (5003ms)
      ✕ should update when a shared dependency changes (5004ms)
      ○ skipped 1 test

  ● /rollup.js › watch mode › should generate updated output for composes changes

    Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.

      73 |         });
      74 | 
    > 75 |         it("should generate updated output for composes changes", (done) => {
         |         ^
      76 |             // Create v1 of the files
      77 |             write(`./watch/change-composes/watched.css`, dedent(`
      78 |                 .one {

      at Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:85:20)
      at Suite.describe (packages/rollup/test/watch.test.js:75:9)
      at Suite.Object.<anonymous>.describe (packages/rollup/test/watch.test.js:20:5)
      at Object.<anonymous> (packages/rollup/test/watch.test.js:19:1)

  ● /rollup.js › watch mode › should update when adding new css files

    Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.

      204 |         });
      205 | 
    > 206 |         it("should update when adding new css files", (done) => {
          |         ^
      207 |             // Create v1 of the files
      208 |             write(`./watch/new-file/one.css`, dedent(`
      209 |                 .one {

      at Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:85:20)
      at Suite.describe (packages/rollup/test/watch.test.js:206:9)
      at Suite.Object.<anonymous>.describe (packages/rollup/test/watch.test.js:20:5)
      at Object.<anonymous> (packages/rollup/test/watch.test.js:19:1)

  ● /rollup.js › watch mode › should update when a shared dependency changes

    Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.

      251 |         });
      252 | 
    > 253 |         it("should update when a shared dependency changes", (done) => {
          |         ^
      254 |             // Create v1 of the files
      255 |             write(`./watch/shared-deps/one.css`, dedent(`
      256 |                 .one {

      at Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:85:20)
      at Suite.describe (packages/rollup/test/watch.test.js:253:9)
      at Suite.Object.<anonymous>.describe (packages/rollup/test/watch.test.js:20:5)
      at Object.<anonymous> (packages/rollup/test/watch.test.js:19:1)

PASS packages/core/test/api.test.js
  /processor.js
    API
      ✓ should be a function (17ms)
      ✓ should auto-instantiate if called without new (1ms)
      .string()
        ✓ should process a string (3ms)
      .file()
        ✓ should process a relative file (3ms)
        ✓ should process an absolute file (2ms)
      .remove()
        ✓ should remove a relative file (1ms)
        ✓ should remove an absolute file (1ms)
        ✓ should remove multiple files (2ms)
        ✓ should return an array of removed files (1ms)
      .dependencies()
        ✓ should return the dependencies of the specified file (10ms)
        ✓ should return the overall order of dependencies if no file is specified (8ms)
      .dependents()
        ✓ should return the dependents of the specified file (8ms)
        ✓ should throw if no file is passed (8ms)
      .output()
        ✓ should return a postcss result (20ms)
        ✓ should generate css representing the output from all added files (17ms)
        ✓ should avoid duplicating files in the output (11ms)
        ✓ should generate a JSON structure of all the compositions (8ms)
        ✓ should order output by dependencies, then alphabetically (16ms)
        ✓ should support returning output for specified relative files (8ms)
        ✓ should support returning output for specified absolute files (9ms)
        ✓ should reject if called before input has been processed (4ms)
        ✓ should allow for seperate source map output (19ms)
      ._resolve()
        ✓ should run resolvers until a match is found (3ms)
        ✓ should fall back to a default resolver (3ms)

(node:5282) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
PASS packages/webpack/test/webpack.test.js
  /webpack.js
    ✓ should be a function (2ms)
    ✓ should output css to disk (276ms)
    ✓ should output json to disk (50ms)
    ✓ should output inline source maps (25ms)
    ✓ should output external source maps to disk (30ms)
    ✓ should report errors (73ms)
    ✓ should report warnings on invalid property names (31ms)
    ✓ should handle dependencies (49ms)
    ✓ should support ES2015 default exports (25ms)
    ✓ should support ES2015 named exports (21ms)
    ✓ should support disabling namedExports when the option is set (30ms)
    ✓ should generate correct builds in watch mode when files change (356ms)
    ✓ should generate correct builds when files change (52ms)

PASS packages/browserify/test/factor-bundle.test.js
  /browserify.js
    factor-bundle
      ✓ should be supported (338ms)
      ✓ should support files w/o commonalities (50ms)
      ✓ should properly handle files w/o dependencies (60ms)
      ✓ should support relative paths within factor-bundle files (67ms)
      ✓ should avoid outputting empty css files by default (56ms)
      ✓ should output empty css files when asked (58ms)

PASS packages/browserify/test/browserify.test.js
  /browserify.js
    basic functionality
      ✓ should not error if no options are supplied (27ms)
      ✓ should error if an invalid extension is applied (4ms)
      ✓ should error on invalid CSS (55ms)
      ✓ should replace require() calls with the exported identifiers (37ms)
      ✓ should correctly rewrite urls based on the destination file (35ms)
      ✓ should use the specified namer function (38ms)
      ✓ should include all CSS dependencies in output css (45ms)
      ✓ should write out the complete exported identifiers when `json` is specified (36ms)
      ✓ should not include duplicate files in the output multiple times (54ms)
      ✓ should output an inline source map when the debug option is specified (47ms)
      ✓ should output an external source map when the debug option is specified (45ms)

PASS packages/svelte/test/svelte.test.js
  /svelte.js
    ✓ should extract CSS from a <style> tag (49ms)
    ✓ should extract CSS from a <link> tag ("no script") (14ms)
    ✓ should extract CSS from a <link> tag ("existing script") (9ms)
    ✓ should extract CSS from a <link> tag ("single quotes") (16ms)
    ✓ should extract CSS from a <link> tag ("unquoted") (9ms)
    ✓ should ignore files without <style> blocks (5ms)
    ✓ should handle invalid references in "<script>" (inline: true, strict: true) (2ms)
    ✓ should handle invalid references in "template" (inline: true, strict: true) (2ms)
    ✓ should handle invalid references in "<script>" (inline: true, strict: false) (5ms)
    ✓ should handle invalid references in "template" (inline: true, strict: false) (2ms)
    ✓ should handle invalid references in "<script>" (inline: false, strict: false) (3ms)
    ✓ should handle invalid references in "template" (inline: false, strict: false) (2ms)
    ✓ should handle invalid references in "<script>" (inline: false, strict: true) (1ms)
    ✓ should handle invalid references in "template" (inline: false, strict: true) (2ms)
    ✓ should throw on both <style> and <link> in one file (1ms)
    ✓ should remove files before reprocessing in case they changed (7ms)

PASS packages/rollup/test/splitting.test.js
  /rollup.js
    code splitting
      ✓ should support splitting up CSS files (38ms)
      ✓ should support splitting up CSS files w/ shared assets (20ms)
      ✓ should support manual chunks (17ms)
      ✓ should support dynamic imports (18ms)

PASS packages/core/test/composition.test.js
  /processor.js
    composition
      ✓ should fail on invalid composes syntax (56ms)
      ✓ should fail if a composition references a non-existant class (5ms)
      ✓ should fail if a composition references a non-existant file (2ms)
      ✓ should fail if composes isn't the first property (3ms)
      ✓ should fail on rules that use multiple selectors (3ms)
      ✓ should compose a single class (3ms)
      ✓ should allow comments before composes (2ms)
      ✓ should compose from globals (2ms)
      ✓ should compose multiple classes (2ms)
      ✓ should compose from other files (5ms)

PASS packages/browserify/test/watchify.test.js
  /browserify.js
    watchify
      ✓ shouldn't cache file contents between watchify runs (282ms)
      ✓ shouldn't explode on invalid CSS (194ms)

PASS packages/postcss/test/postcss.test.js
  /postcss.js
    ✓ should be a function (2ms)
    ✓ should process CSS and output the result (34ms)
    ✓ should process CSS with dependencies and output the result (14ms)
    ✓ should process CSS and output exports as a message (2ms)
    ✓ should accept normal processor options (5ms)
    ✓ should accept a `json` property and write exports to that file (16ms)
    ✓ should use output filepath for json if a custom path isn't provided (9ms)
    ✓ should be usable like a normal postcss plugin (3ms)
    ✓ should output json when used within postcss (2ms)
    ✓ should accept json args in either position with postcss (1ms)

PASS packages/core/test/values.test.js
  /processor.js
    values
      ✓ should fail on invalid value syntax (62ms)
      ✓ should fail if a value imports a non-existant reference (3ms)
      ✓ should support simple values (4ms)
      ✓ should support local values in value composition (8ms)
      ✓ should support importing variables from a file (5ms)
      ✓ should support exporting imported variables (7ms)
      ✓ should support value composition (5ms)
      ✓ should support value namespaces (4ms)
      ✓ should support value replacement in :external(...) (18ms)

PASS packages/aliases/test/aliases.test.js
  modular-css-aliases
    ✓ should return a falsey value if a file isn't found (3ms)
    ✓ should return the absolute path if a file is found
    ✓ should check multiple aliases for files & return the first match (1ms)
    ✓ should be usable as a modular-css resolver (27ms)
    ✓ should fall through to the default resolver (8ms)

PASS packages/core/test/scoping.test.js
  /processor.js
    scoping
      ✓ should scope classes, ids, and keyframes (30ms)
      ✓ should handle pseudo classes correctly (4ms)
      ✓ should not allow :global classes to overlap with local ones (local before global) (41ms)
      ✓ should not allow :global classes to overlap with local ones (global before local) (2ms)
      ✓ should not allow empty :global() selectors (2ms)

PASS packages/core/test/keyframes.test.js
  /processor.js
    scoping
      ✓ should leave unknown animation names alone (21ms)
      ✓ should update scoped animations from the scoping plugin's message (3ms)
      ✓ should update the animation-name property (2ms)
      ✓ should update multiple animations properly (10ms)
      ✓ should update scoped prefixed animations from the scoping plugin's message (2ms)

PASS packages/browserify/test/issue-58.test.js
  /browserify.js
    /issues
      /58
        ✓ should update when CSS dependencies change (216ms)

PASS packages/browserify/test/issue-313.test.js
  /browserify.js
    /issues
      /313
        ✓ should include all dependencies after watchify update (363ms)

PASS packages/cli/test/cli.test.js
  /cli.js
    ✓ should show help with no args (221ms)
    ✓ should default to outputting to stdout (283ms)
    ✓ should support outputting to a file (--out) (284ms)
    ✓ should support outputting compositions to a file (--json) (285ms)
    ✓ should return the correct error code on invalid CSS (283ms)
    ✓ should support disabling url() rewriting (--no-rewrite) (258ms)

PASS packages/paths/test/paths.test.js
  modular-css-paths
    ✓ should return a falsey value if a file isn't found (3ms)
    ✓ should return the absolute path if a file is found
    ✓ should check multiple paths for files & return the first match
    ✓ should be usable as a modular-css resolver (38ms)

PASS packages/core/test/externals.test.js
  /processor.js
    externals
      ✓ should fail if not a valid composition reference (61ms)
      ✓ should fail if not referencing another file (4ms)
      ✓ should fail on bad class references (15ms)
      ✓ should support overriding external values (19ms)

PASS packages/namer/test/index.test.js
  modular-css-namer
    ✓ should hash its arguments (2ms)
    ✓ should differ within files (9ms)
    ✓ should re-use selectors for identical inputs (1ms)
    ✓ should differ between files
    ✓ should wrap as necessary (91ms)

PASS packages/core/test/exports.test.js
  /processor.js
    exports
      ✓ should export an object of arrays containing strings (21ms)
      ✓ should export identifiers and their classes (12ms)

PASS packages/glob/test/glob.test.js
  /glob.js
    ✓ should be a function (1ms)
    ✓ should use a default search (30ms)
    ✓ should find files on disk & output css (6ms)
    ✓ should support exclusion patterns (6ms)

PASS packages/core/test/getters.test.js
  /processor.js
    getters
      .file
        ✓ should return all the files that have been added (36ms)
      .options
        ✓ should return the merged options object (1ms)

PASS packages/core/test/issues/issue-56.test.js
  /issues
    /56
      ✓ should prune rules that only compose, but leave them in the exports (23ms)

PASS packages/core/test/issues/issue-24.test.js
  /issues
    /24
      ✓ should be able to compose using a value (25ms)

PASS packages/core/test/issues/issue-98.test.js
  /issues
    /98
      ✓ should prune rules that only compose, but leave them in the exports (22ms)

PASS packages/core/test/unicode.test.js
  /processor.js
    unicode
      ✓ should support unicode classes & ids (41ms)

PASS packages/core/test/issues/issue-66.test.js
  /issues
    /66
      ✓ should ignore remove calls for unknown files (19ms)

PASS packages/core/test/issues/issue-261.test.js
  /issues
    /261
      ✓ should allow colons in rules that also use :external() (34ms)

Summary of all failing tests
FAIL packages/rollup/test/watch.test.js (15.708s)
  ● /rollup.js › watch mode › should generate updated output for composes changes

    Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.

      73 |         });
      74 | 
    > 75 |         it("should generate updated output for composes changes", (done) => {
         |         ^
      76 |             // Create v1 of the files
      77 |             write(`./watch/change-composes/watched.css`, dedent(`
      78 |                 .one {

      at Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:85:20)
      at Suite.describe (packages/rollup/test/watch.test.js:75:9)
      at Suite.Object.<anonymous>.describe (packages/rollup/test/watch.test.js:20:5)
      at Object.<anonymous> (packages/rollup/test/watch.test.js:19:1)

  ● /rollup.js › watch mode › should update when adding new css files

    Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.

      204 |         });
      205 | 
    > 206 |         it("should update when adding new css files", (done) => {
          |         ^
      207 |             // Create v1 of the files
      208 |             write(`./watch/new-file/one.css`, dedent(`
      209 |                 .one {

      at Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:85:20)
      at Suite.describe (packages/rollup/test/watch.test.js:206:9)
      at Suite.Object.<anonymous>.describe (packages/rollup/test/watch.test.js:20:5)
      at Object.<anonymous> (packages/rollup/test/watch.test.js:19:1)

  ● /rollup.js › watch mode › should update when a shared dependency changes

    Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.

      251 |         });
      252 | 
    > 253 |         it("should update when a shared dependency changes", (done) => {
          |         ^
      254 |             // Create v1 of the files
      255 |             write(`./watch/shared-deps/one.css`, dedent(`
      256 |                 .one {

      at Spec (node_modules/jest-jasmine2/build/jasmine/Spec.js:85:20)
      at Suite.describe (packages/rollup/test/watch.test.js:253:9)
      at Suite.Object.<anonymous>.describe (packages/rollup/test/watch.test.js:20:5)
      at Object.<anonymous> (packages/rollup/test/watch.test.js:19:1)


Test Suites: 1 failed, 2 skipped, 30 passed, 31 of 33 total
Tests:       3 failed, 5 skipped, 201 passed, 209 total
Snapshots:   247 passed, 247 total
Time:        31.861s
Ran all test suites.
npm ERR! Test failed.  See above for more details.

@tivac tivac merged commit 5238ade into master Aug 9, 2018

2 of 4 checks passed

codecov/patch 98.18% of diff hit (target 99.02%)
Details
codecov/project 98.91% (-0.11%) compared to 3824f41
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@tivac tivac deleted the async-await branch Aug 9, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.