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(svelte): properly trigger components to re-render on change #580

Merged
merged 18 commits into from Apr 30, 2019

Conversation

Projects
None yet
2 participants
@tivac
Copy link
Owner

commented Apr 30, 2019

Description

Fix the dependencies returned by @modular-css/svelte so that it includes the file referenced by a <link> so all the files in the dependency tree are properly being monitored.

Motivation and Context

We were seeing an issue where sometimes composes changes aren't reflected in the JS generated by rollup-plugin-svelte.

This likely also fixes #571

How Has This Been Tested?

Added a test for it.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Still working on getting tests to pass without fun snapshot issues.

@tivac tivac self-assigned this Apr 30, 2019

@TravisBuddy

This comment has been minimized.

Copy link

commented Apr 30, 2019

Hey @tivac,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: c2ed9cd0-6b18-11e9-9dda-bbc728ae4625
@TravisBuddy

This comment has been minimized.

Copy link

commented Apr 30, 2019

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

View build log

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


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


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

PASS lint packages/rollup/test/rollup.test.js
  ● Console

    console.warn 
      
      /home/travis/build/tivac/modular-css/packages/rollup/test/rollup.test.js
        739:9  warning  Skipped test  jest/no-disabled-tests
      
      ✖ 1 problem (0 errors, 1 warning)
      

PASS lint packages/processor/test/options.test.js
PASS lint packages/processor/test/api.test.js
PASS lint packages/rollup/test/watch.test.js
PASS lint packages/processor/processor.js
PASS lint packages/rollup/test/splitting.test.js
PASS lint packages/svelte/test/svelte.test.js
PASS lint packages/rollup/rollup.js
PASS lint packages/webpack/test/webpack.test.js
  ● Console

    console.warn 
      
      /home/travis/build/tivac/modular-css/packages/webpack/test/webpack.test.js
        126:5  warning  Skipped test  jest/no-disabled-tests
      
      ✖ 1 problem (0 errors, 1 warning)
      

PASS lint packages/browserify/browserify.js
PASS lint packages/svelte/svelte.js
PASS lint packages/browserify/test/factor-bundle.test.js
PASS lint packages/svelte/test/rollup.test.js
PASS lint packages/browserify/test/browserify.test.js
PASS lint packages/processor/test/composition.test.js
PASS lint packages/rollup-rewriter/test/rewriter.test.js
PASS lint packages/processor/test/values.test.js
PASS lint packages/www/src/repl/store.js
PASS lint packages/www/rollup.config.js
PASS lint packages/postcss/test/postcss.test.js
PASS lint packages/browserify/test/watchify.test.js
PASS lint packages/rollup-rewriter/rewriter.js
PASS lint packages/rollup/chunker.js
PASS lint packages/scratchpad/chunks.js
PASS lint packages/processor/plugins/composition.js
PASS lint packages/processor/plugins/scoping.js
PASS lint packages/processor/plugins/values-replace.js
PASS lint packages/webpack/plugin.js
PASS lint packages/aliases/test/aliases.test.js
PASS lint packages/processor/test/scoping.test.js
PASS lint packages/processor/test/keyframes.test.js
PASS lint packages/browserify/test/issue-58.test.js
PASS lint packages/browserify/test/issue-313.test.js
PASS lint packages/cli/test/cli.test.js
PASS lint packages/paths/test/paths.test.js
PASS lint packages/processor/plugins/externals.js
PASS lint packages/processor/test/externals.test.js
PASS lint packages/processor/plugins/graph-nodes.js
PASS lint packages/webpack/loader.js
PASS lint packages/cli/cli.js
PASS lint packages/browserify/test/issue-105.test.js
  ● Console

    console.warn 
      
      /home/travis/build/tivac/modular-css/packages/browserify/test/issue-105.test.js
        16:13  warning  Skipped test  jest/no-disabled-tests
        23:13  warning  Skipped test  jest/no-disabled-tests
      
      ✖ 2 problems (0 errors, 2 warnings)
      

PASS lint packages/processor/test/getters.test.js
PASS lint packages/scratchpad/test/chunks.test.js
PASS lint packages/www/build/html/guide.js
PASS lint packages/www/build/rollup-plugin-postcss.js
PASS lint packages/namer/test/namer.test.js
PASS lint packages/www/build/html/repl.js
PASS lint packages/glob/test/glob.test.js
PASS lint packages/postcss/postcss.js
PASS lint packages/www/build/rollup-plugin-generate-html.js
PASS lint packages/processor/test/exports.test.js
PASS lint packages/namer/namer.js
PASS lint packages/www/build/html/changelog.js
PASS lint packages/processor/test/issues/issue-191.test.js
PASS lint packages/www/build/html/home.js
PASS lint packages/processor/test/issues/issue-56.test.js
PASS lint packages/processor/test/issues/issue-24.test.js
PASS lint packages/www/build/html/css.js
PASS lint packages/processor/test/issues/issue-98.test.js
PASS lint packages/processor/plugins/values-local.js
PASS lint packages/processor/plugins/values-composed.js
PASS lint packages/processor/plugins/values-namespaced.js
PASS lint packages/processor/plugins/values-imported.js
PASS lint packages/scratchpad/chunktest.js
PASS lint packages/www/build/svelte.js
PASS lint packages/processor/plugins/values-export.js
PASS lint packages/scratchpad/test/construct.js
PASS lint packages/www/build/rollup-plugin-sirv.js
PASS lint packages/processor/plugins/keyframes.js
PASS lint packages/rollup-rewriter/formats/amd.js
PASS lint packages/processor/test/unicode.test.js
PASS lint packages/aliases/aliases.js
PASS lint packages/processor/lib/graph-tiers.js
PASS lint packages/rollup-rewriter/formats/system.js
PASS lint packages/glob/glob.js
PASS lint packages/test-utils/logs.js
PASS lint packages/processor/lib/resolve.js
PASS lint packages/processor/lib/output.js
PASS lint packages/test-utils/expect/toMatchRollupSnapshot.js
PASS lint packages/processor/test/issues/issue-66.test.js
PASS lint packages/processor/test/issues/issue-261.test.js
PASS lint packages/test-utils/read-dir.js
PASS lint packages/www/src/repl/listen.js
PASS lint packages/www/build/rollup-plugin-add-watch-files.js
PASS lint packages/test-utils/expect/toMatchRollupCodeSnapshot.js
PASS lint packages/processor/lib/identifiers.js
PASS lint packages/paths/paths.js
PASS lint packages/browserify/test/lib/bundle.js
PASS lint packages/scratchpad/test/snapshot.js
PASS lint packages/processor/lib/normalize.js
PASS lint packages/test-utils/write.js
PASS lint packages/rollup-rewriter/formats/es.js
PASS lint packages/test-utils/relative.js
PASS lint packages/test-utils/rollup-watching.js
PASS lint packages/processor/lib/message.js
PASS lint packages/www/src/repl/data/prompt.js
PASS lint packages/www/build/rollup-plugin-clean.js
PASS lint packages/www/build/environment.js
PASS lint packages/processor/lib/relative.js
PASS lint packages/www/stubs/path.js
PASS lint packages/www/build/html/markdown.js
PASS lint packages/test-utils/read.js
PASS lint packages/test-utils/exists.js
PASS lint packages/www/src/repl/codemirror.js
PASS lint packages/test-utils/warn.js
PASS lint packages/test-utils/expect/toMatchDiffSnapshot.js
PASS lint packages/test-utils/prefix.js
PASS lint packages/test-utils/namer.js
PASS lint packages/www/stubs/fs.js
PASS lint packages/www/src/repl/index.js
PASS tests packages/rollup/test/rollup.test.js
PASS tests packages/processor/test/options.test.js
PASS tests packages/processor/test/api.test.js
PASS tests packages/rollup/test/watch.test.js
PASS tests packages/rollup/test/splitting.test.js
PASS tests packages/svelte/test/svelte.test.js
(node:5273) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
PASS tests packages/webpack/test/webpack.test.js
PASS tests packages/browserify/test/factor-bundle.test.js
FAIL tests packages/svelte/test/rollup.test.js
  ● /svelte.js › rollup watching › should generate updated output

    expect(received).toMatchSnapshot()

    Snapshot name: `/svelte.js rollup watching should generate updated output 1`

    - Snapshot
    + Received

    @@ -16,11 +16,11 @@
      @@ -150,19 +154,21 @@
        	_mount,
        	_differs
        };
        
    -   /* packages\\svelte\\test\\output\\rollup\\input\\app.html generated by Svelte v2.16.1 */
    +   /* packages/svelte/test/output/rollup/input/app.html generated by Svelte v2.16.1 */
      + 
        
      + 
        function create_main_fragment(component, ctx) {
        	var div;

      89 |                 v2 = dir("./rollup/output/");
      90 | 
    > 91 |                 expect(v1).toMatchDiffSnapshot(v2);
         |                            ^
      92 | 
      93 |                 return done();
      94 |             }));

      at toMatchDiffSnapshot (packages/svelte/test/rollup.test.js:91:28)
      at class_1.cb (packages/test-utils/rollup-watching.js:17:9)
      at Watcher.Object.<anonymous>.Watcher.emit (node_modules/rollup/dist/rollup.js:38325:22)
      at node_modules/rollup/dist/rollup.js:38364:19

 › 1 snapshot failed.
PASS tests packages/browserify/test/browserify.test.js
PASS tests packages/processor/test/composition.test.js
PASS tests packages/rollup-rewriter/test/rewriter.test.js
PASS tests packages/processor/test/values.test.js
PASS tests packages/postcss/test/postcss.test.js
PASS tests packages/browserify/test/watchify.test.js
PASS tests packages/aliases/test/aliases.test.js
PASS tests packages/processor/test/scoping.test.js
PASS tests packages/processor/test/keyframes.test.js
PASS tests packages/browserify/test/issue-58.test.js
PASS tests packages/browserify/test/issue-313.test.js
PASS tests packages/cli/test/cli.test.js
PASS tests packages/paths/test/paths.test.js
PASS tests packages/processor/test/externals.test.js
PASS tests packages/processor/test/getters.test.js
PASS tests packages/scratchpad/test/chunks.test.js
PASS tests packages/namer/test/namer.test.js
PASS tests packages/glob/test/glob.test.js
PASS tests packages/processor/test/exports.test.js
PASS tests packages/processor/test/issues/issue-56.test.js
PASS tests packages/processor/test/issues/issue-24.test.js
PASS tests packages/processor/test/issues/issue-98.test.js
PASS tests packages/processor/test/unicode.test.js
PASS tests packages/processor/test/issues/issue-66.test.js
PASS tests packages/processor/test/issues/issue-261.test.js

Summary of all failing tests
FAIL packages/svelte/test/rollup.test.js
  ● /svelte.js › rollup watching › should generate updated output

    expect(received).toMatchSnapshot()

    Snapshot name: `/svelte.js rollup watching should generate updated output 1`

    - Snapshot
    + Received

    @@ -16,11 +16,11 @@
      @@ -150,19 +154,21 @@
        	_mount,
        	_differs
        };
        
    -   /* packages\\svelte\\test\\output\\rollup\\input\\app.html generated by Svelte v2.16.1 */
    +   /* packages/svelte/test/output/rollup/input/app.html generated by Svelte v2.16.1 */
      + 
        
      + 
        function create_main_fragment(component, ctx) {
        	var div;

      89 |                 v2 = dir("./rollup/output/");
      90 | 
    > 91 |                 expect(v1).toMatchDiffSnapshot(v2);
         |                            ^
      92 | 
      93 |                 return done();
      94 |             }));

      at toMatchDiffSnapshot (packages/svelte/test/rollup.test.js:91:28)
      at class_1.cb (packages/test-utils/rollup-watching.js:17:9)
      at Watcher.Object.<anonymous>.Watcher.emit (node_modules/rollup/dist/rollup.js:38325:22)
      at node_modules/rollup/dist/rollup.js:38364:19


Snapshot Summary
 › 1 snapshot failed from 1 test suite. Inspect your code changes or run `npm test -- -u` to update them.

Test Suites: 1 failed, 76 skipped, 143 passed, 144 of 220 total
Tests:       1 failed, 80 skipped, 386 passed, 467 total
Snapshots:   1 failed, 311 passed, 312 total
Time:        34.633s
Ran all test suites in 2 projects.
npm ERR! Test failed.  See above for more details.
TravisBuddy Request Identifier: f4fe2af0-6b59-11e9-9dda-bbc728ae4625
@TravisBuddy

This comment has been minimized.

Copy link

commented Apr 30, 2019

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

View build log

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


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


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

PASS lint packages/rollup/test/rollup.test.js
  ● Console

    console.warn 
      
      /home/travis/build/tivac/modular-css/packages/rollup/test/rollup.test.js
        739:9  warning  Skipped test  jest/no-disabled-tests
      
      ✖ 1 problem (0 errors, 1 warning)
      

PASS lint packages/processor/test/options.test.js
PASS lint packages/processor/test/api.test.js
PASS lint packages/rollup/test/watch.test.js
PASS lint packages/processor/processor.js
PASS lint packages/rollup/test/splitting.test.js
PASS lint packages/svelte/test/svelte.test.js
PASS lint packages/rollup/rollup.js
PASS lint packages/webpack/test/webpack.test.js
  ● Console

    console.warn 
      
      /home/travis/build/tivac/modular-css/packages/webpack/test/webpack.test.js
        126:5  warning  Skipped test  jest/no-disabled-tests
      
      ✖ 1 problem (0 errors, 1 warning)
      

PASS lint packages/browserify/browserify.js
PASS lint packages/svelte/svelte.js
PASS lint packages/svelte/test/rollup.test.js
PASS lint packages/browserify/test/factor-bundle.test.js
PASS lint packages/browserify/test/browserify.test.js
PASS lint packages/processor/test/composition.test.js
PASS lint packages/rollup-rewriter/test/rewriter.test.js
PASS lint packages/processor/test/values.test.js
PASS lint packages/www/src/repl/store.js
PASS lint packages/www/rollup.config.js
PASS lint packages/postcss/test/postcss.test.js
PASS lint packages/browserify/test/watchify.test.js
PASS lint packages/rollup-rewriter/rewriter.js
PASS lint packages/rollup/chunker.js
PASS lint packages/scratchpad/chunks.js
PASS lint packages/processor/plugins/composition.js
PASS lint packages/processor/plugins/scoping.js
PASS lint packages/processor/plugins/values-replace.js
PASS lint packages/webpack/plugin.js
PASS lint packages/aliases/test/aliases.test.js
PASS lint packages/processor/test/scoping.test.js
PASS lint packages/processor/test/keyframes.test.js
PASS lint packages/browserify/test/issue-58.test.js
PASS lint packages/browserify/test/issue-313.test.js
PASS lint packages/cli/test/cli.test.js
PASS lint packages/paths/test/paths.test.js
PASS lint packages/processor/plugins/externals.js
PASS lint packages/processor/test/externals.test.js
PASS lint packages/processor/plugins/graph-nodes.js
PASS lint packages/webpack/loader.js
PASS lint packages/cli/cli.js
PASS lint packages/browserify/test/issue-105.test.js
  ● Console

    console.warn 
      
      /home/travis/build/tivac/modular-css/packages/browserify/test/issue-105.test.js
        16:13  warning  Skipped test  jest/no-disabled-tests
        23:13  warning  Skipped test  jest/no-disabled-tests
      
      ✖ 2 problems (0 errors, 2 warnings)
      

PASS lint packages/processor/test/getters.test.js
PASS lint packages/scratchpad/test/chunks.test.js
PASS lint packages/www/build/html/guide.js
PASS lint packages/www/build/rollup-plugin-postcss.js
PASS lint packages/namer/test/namer.test.js
PASS lint packages/www/build/html/repl.js
PASS lint packages/glob/test/glob.test.js
PASS lint packages/postcss/postcss.js
PASS lint packages/www/build/rollup-plugin-generate-html.js
PASS lint packages/processor/test/exports.test.js
PASS lint packages/namer/namer.js
PASS lint packages/www/build/html/changelog.js
PASS lint packages/processor/test/issues/issue-191.test.js
PASS lint packages/www/build/html/home.js
PASS lint packages/processor/test/issues/issue-56.test.js
PASS lint packages/processor/test/issues/issue-24.test.js
PASS lint packages/www/build/html/css.js
PASS lint packages/processor/test/issues/issue-98.test.js
PASS lint packages/processor/plugins/values-local.js
PASS lint packages/processor/plugins/values-composed.js
PASS lint packages/processor/plugins/values-namespaced.js
PASS lint packages/processor/plugins/values-imported.js
PASS lint packages/scratchpad/chunktest.js
PASS lint packages/www/build/svelte.js
PASS lint packages/processor/plugins/values-export.js
PASS lint packages/scratchpad/test/construct.js
PASS lint packages/www/build/rollup-plugin-sirv.js
PASS lint packages/processor/plugins/keyframes.js
PASS lint packages/rollup-rewriter/formats/amd.js
PASS lint packages/processor/test/unicode.test.js
PASS lint packages/aliases/aliases.js
PASS lint packages/processor/lib/graph-tiers.js
PASS lint packages/rollup-rewriter/formats/system.js
PASS lint packages/glob/glob.js
PASS lint packages/test-utils/logs.js
PASS lint packages/processor/lib/resolve.js
PASS lint packages/processor/lib/output.js
PASS lint packages/test-utils/expect/toMatchRollupSnapshot.js
PASS lint packages/processor/test/issues/issue-66.test.js
PASS lint packages/processor/test/issues/issue-261.test.js
PASS lint packages/test-utils/read-dir.js
PASS lint packages/www/src/repl/listen.js
PASS lint packages/www/build/rollup-plugin-add-watch-files.js
PASS lint packages/test-utils/expect/toMatchRollupCodeSnapshot.js
PASS lint packages/processor/lib/identifiers.js
PASS lint packages/paths/paths.js
PASS lint packages/browserify/test/lib/bundle.js
PASS lint packages/scratchpad/test/snapshot.js
PASS lint packages/processor/lib/normalize.js
PASS lint packages/test-utils/write.js
PASS lint packages/rollup-rewriter/formats/es.js
PASS lint packages/test-utils/relative.js
PASS lint packages/test-utils/rollup-watching.js
PASS lint packages/processor/lib/message.js
PASS lint packages/www/src/repl/data/prompt.js
PASS lint packages/www/build/rollup-plugin-clean.js
PASS lint packages/www/build/environment.js
PASS lint packages/processor/lib/relative.js
PASS lint packages/www/stubs/path.js
PASS lint packages/www/build/html/markdown.js
PASS lint packages/test-utils/read.js
PASS lint packages/test-utils/exists.js
PASS lint packages/www/src/repl/codemirror.js
PASS lint packages/test-utils/warn.js
PASS lint packages/test-utils/expect/toMatchDiffSnapshot.js
PASS lint packages/test-utils/prefix.js
PASS lint packages/test-utils/namer.js
PASS lint packages/www/stubs/fs.js
PASS lint packages/www/src/repl/index.js
PASS tests packages/rollup/test/rollup.test.js
PASS tests packages/processor/test/options.test.js
PASS tests packages/processor/test/api.test.js
PASS tests packages/rollup/test/watch.test.js
PASS tests packages/rollup/test/splitting.test.js
FAIL tests packages/svelte/test/svelte.test.js
  ● /svelte.js › should ignore <links> that reference a URL

    expect(received).toMatchSnapshot()

    Snapshot name: `/svelte.js should ignore <links> that reference a URL 1`

    - Snapshot
    + Received

      "<link rel="stylesheet" href="http://example.com/styles.css" />
    - 
      <div class="fooga">fooga</div>
      <script>import css from "./simple.css";</script>"

      71 |         );
      72 | 
    > 73 |         expect(processed.toString()).toMatchSnapshot();
         |                                      ^
      74 | 
      75 |         const output = await processor.output();
      76 | 

      at Object.toMatchSnapshot (packages/svelte/test/svelte.test.js:73:38)

  ● /svelte.js › should use an already-created processor

    expect(received).toMatchSnapshot()

    Snapshot name: `/svelte.js should use an already-created processor 1`

    - Snapshot
    + Received

      "<link rel="stylesheet" href="http://example.com/styles.css" />
    - 
      <div class="fooga">fooga</div>
      <script>import css from "./simple.css";</script>"

       96 |         );
       97 | 
    >  98 |         expect(processed.toString()).toMatchSnapshot();
          |                                      ^
       99 | 
      100 |         const output = await processor.output();
      101 | 

      at Object.toMatchSnapshot (packages/svelte/test/svelte.test.js:98:38)

  ● /svelte.js › should extract CSS from a <link> tag (no script)

    expect(received).toMatchSnapshot()

    Snapshot name: `/svelte.js should extract CSS from a <link> tag (no script) 1`

    - Snapshot
    + Received

    @@ -1,7 +1,6 @@
    - "
    - <div class="flex wrapper">
    + "<div class="flex wrapper">
          <h1 class="flex fooga hd">Head</h1>
          <div class="fooga wooga bd">
              <p class="{bool ? "text" : "active" }">Text</p>
          </div>
      </div>

      121 |         );
      122 | 
    > 123 |         expect(processed.toString()).toMatchSnapshot();
          |                                      ^
      124 | 
      125 |         const output = await processor.output();
      126 | 

      at toMatchSnapshot (packages/svelte/test/svelte.test.js:123:38)

  ● /svelte.js › should extract CSS from a <link> tag (existing script)

    expect(received).toMatchSnapshot()

    Snapshot name: `/svelte.js should extract CSS from a <link> tag (existing script) 1`

    - Snapshot
    + Received

    @@ -1,7 +1,6 @@
    - "
    - <div class="flex wrapper">
    + "<div class="flex wrapper">
          <h1 class="flex fooga hd">Head</h1>
          <div class="fooga wooga bd">
              <p class="{bool ? "text" : "active" }">Text</p>
          </div>
      </div>

      121 |         );
      122 | 
    > 123 |         expect(processed.toString()).toMatchSnapshot();
          |                                      ^
      124 | 
      125 |         const output = await processor.output();
      126 | 

      at toMatchSnapshot (packages/svelte/test/svelte.test.js:123:38)

  ● /svelte.js › should extract CSS from a <link> tag (single quotes)

    expect(received).toMatchSnapshot()

    Snapshot name: `/svelte.js should extract CSS from a <link> tag (single quotes) 1`

    - Snapshot
    + Received

    @@ -1,7 +1,6 @@
    - "
    - <div class="flex wrapper">
    + "<div class="flex wrapper">
          <h1 class="flex fooga hd">Head</h1>
          <div class="fooga wooga bd">
              <p class="{bool ? "text" : "active" }">Text</p>
          </div>
      </div>

      121 |         );
      122 | 
    > 123 |         expect(processed.toString()).toMatchSnapshot();
          |                                      ^
      124 | 
      125 |         const output = await processor.output();
      126 | 

      at toMatchSnapshot (packages/svelte/test/svelte.test.js:123:38)

  ● /svelte.js › should extract CSS from a <link> tag (unquoted)

    expect(received).toMatchSnapshot()

    Snapshot name: `/svelte.js should extract CSS from a <link> tag (unquoted) 1`

    - Snapshot
    + Received

    @@ -1,7 +1,6 @@
    - "
    - <div class="flex wrapper">
    + "<div class="flex wrapper">
          <h1 class="flex fooga hd">Head</h1>
          <div class="fooga wooga bd">
              <p class="{bool ? "text" : "active" }">Text</p>
          </div>
      </div>

      121 |         );
      122 | 
    > 123 |         expect(processed.toString()).toMatchSnapshot();
          |                                      ^
      124 | 
      125 |         const output = await processor.output();
      126 | 

      at toMatchSnapshot (packages/svelte/test/svelte.test.js:123:38)

  ● /svelte.js › should extract CSS from a <link> tag (values)

    expect(received).toMatchSnapshot()

    Snapshot name: `/svelte.js should extract CSS from a <link> tag (values) 1`

    - Snapshot
    + Received

    @@ -1,7 +1,6 @@
    - "
    - <div
    + "<div
          data-simple="color: #BEEFED"
          data-expression="{"color: " + "#BEEFED"}"
          data-template="{`color: ${"#BEEFED"}`}"
      >
      </div>

      121 |         );
      122 | 
    > 123 |         expect(processed.toString()).toMatchSnapshot();
          |                                      ^
      124 | 
      125 |         const output = await processor.output();
      126 | 

      at toMatchSnapshot (packages/svelte/test/svelte.test.js:123:38)

  ● /svelte.js › should handle errors: invalid reference <script> - <link>

    expect(received).toMatchSnapshot()

    Snapshot name: `/svelte.js should handle errors: invalid reference <script> - <link> 3`

    - Snapshot
    + Received

    @@ -1,7 +1,6 @@
    - "
    - <h2 class="yup">Yup</h2>
    + "<h2 class="yup">Yup</h2>
      
      <script>
      import css from "./invalid.css";

      183 |         expect(warnSpy.mock.calls).toMatchSnapshot();
      184 | 
    > 185 |         expect(processed.toString()).toMatchSnapshot();
          |                                      ^
      186 |     });
      187 | 
      188 |     it("should throw on both <style> and <link> in one file", async () => {

        
        
      at toMatchSnapshot (packages/svelte/test/svelte.test.js:185:38)

  ● /svelte.js › should handle errors: invalid reference template - <link>

    expect(received).toMatchSnapshot()

    Snapshot name: `/svelte.js should handle errors: invalid reference template - <link> 3`

    - Snapshot
    + Received

    - "
    - <h1 class="{"css.nope"}">Nope</h1>
    + "<h1 class="{"css.nope"}">Nope</h1>
      <h2 class="yup">Yup</h2>
      <h3 class="{"css.stillnope"}">Still Nope</h3>
      <script>import css from "./invalid.css";</script>"

      183 |         expect(warnSpy.mock.calls).toMatchSnapshot();
      184 | 
    > 185 |         expect(processed.toString()).toMatchSnapshot();
          |                                      ^
      186 |     });
      187 | 
      188 |     it("should throw on both <style> and <link> in one file", async () => {

      at toMatchSnapshot (packages/svelte/test/svelte.test.js:185:38)

  ● /svelte.js › should handle errors: empty css file - <link>

    expect(received).toMatchSnapshot()

    Snapshot name: `/svelte.js should handle errors: empty css file - <link> 3`

    - Snapshot
    + Received

    - "
    - <div class="{"css.nope"}">NOPE</div>
    + "<div class="{"css.nope"}">NOPE</div>
      <div class="{"css.alsonope"}">STILL NOPE</div>
      <script>import css from "./empty.css";</script>"

      183 |         expect(warnSpy.mock.calls).toMatchSnapshot();
      184 | 
    > 185 |         expect(processed.toString()).toMatchSnapshot();
          |                                      ^
      186 |     });
      187 | 
      188 |     it("should throw on both <style> and <link> in one file", async () => {

      at toMatchSnapshot (packages/svelte/test/svelte.test.js:185:38)

 › 10 snapshots failed.
(node:5288) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
PASS tests packages/webpack/test/webpack.test.js
PASS tests packages/svelte/test/rollup.test.js
PASS tests packages/browserify/test/factor-bundle.test.js
PASS tests packages/browserify/test/browserify.test.js
PASS tests packages/processor/test/composition.test.js
PASS tests packages/rollup-rewriter/test/rewriter.test.js
PASS tests packages/processor/test/values.test.js
PASS tests packages/postcss/test/postcss.test.js
PASS tests packages/browserify/test/watchify.test.js
PASS tests packages/aliases/test/aliases.test.js
PASS tests packages/processor/test/scoping.test.js
PASS tests packages/processor/test/keyframes.test.js
PASS tests packages/browserify/test/issue-58.test.js
PASS tests packages/browserify/test/issue-313.test.js
PASS tests packages/cli/test/cli.test.js
PASS tests packages/paths/test/paths.test.js
PASS tests packages/processor/test/externals.test.js
PASS tests packages/processor/test/getters.test.js
PASS tests packages/scratchpad/test/chunks.test.js
PASS tests packages/namer/test/namer.test.js
PASS tests packages/glob/test/glob.test.js
PASS tests packages/processor/test/exports.test.js
PASS tests packages/processor/test/issues/issue-56.test.js
PASS tests packages/processor/test/issues/issue-24.test.js
PASS tests packages/processor/test/issues/issue-98.test.js
PASS tests packages/processor/test/unicode.test.js
PASS tests packages/processor/test/issues/issue-66.test.js
PASS tests packages/processor/test/issues/issue-261.test.js

Summary of all failing tests
FAIL packages/svelte/test/svelte.test.js
  ● /svelte.js › should ignore <links> that reference a URL

    expect(received).toMatchSnapshot()

    Snapshot name: `/svelte.js should ignore <links> that reference a URL 1`

    - Snapshot
    + Received

      "<link rel="stylesheet" href="http://example.com/styles.css" />
    - 
      <div class="fooga">fooga</div>
      <script>import css from "./simple.css";</script>"

      71 |         );
      72 | 
    > 73 |         expect(processed.toString()).toMatchSnapshot();
         |                                      ^
      74 | 
      75 |         const output = await processor.output();
      76 | 

      at Object.toMatchSnapshot (packages/svelte/test/svelte.test.js:73:38)

  ● /svelte.js › should use an already-created processor

    expect(received).toMatchSnapshot()

    Snapshot name: `/svelte.js should use an already-created processor 1`

    - Snapshot
    + Received

      "<link rel="stylesheet" href="http://example.com/styles.css" />
    - 
      <div class="fooga">fooga</div>
      <script>import css from "./simple.css";</script>"

       96 |         );
       97 | 
    >  98 |         expect(processed.toString()).toMatchSnapshot();
          |                                      ^
       99 | 
      100 |         const output = await processor.output();
      101 | 

      at Object.toMatchSnapshot (packages/svelte/test/svelte.test.js:98:38)

  ● /svelte.js › should extract CSS from a <link> tag (no script)

    expect(received).toMatchSnapshot()

    Snapshot name: `/svelte.js should extract CSS from a <link> tag (no script) 1`

    - Snapshot
    + Received

    @@ -1,7 +1,6 @@
    - "
    - <div class="flex wrapper">
    + "<div class="flex wrapper">
          <h1 class="flex fooga hd">Head</h1>
          <div class="fooga wooga bd">
              <p class="{bool ? "text" : "active" }">Text</p>
          </div>
      </div>

      121 |         );
      122 | 
    > 123 |         expect(processed.toString()).toMatchSnapshot();
          |                                      ^
      124 | 
      125 |         const output = await processor.output();
      126 | 

      at toMatchSnapshot (packages/svelte/test/svelte.test.js:123:38)

  ● /svelte.js › should extract CSS from a <link> tag (existing script)

    expect(received).toMatchSnapshot()

    Snapshot name: `/svelte.js should extract CSS from a <link> tag (existing script) 1`

    - Snapshot
    + Received

    @@ -1,7 +1,6 @@
    - "
    - <div class="flex wrapper">
    + "<div class="flex wrapper">
          <h1 class="flex fooga hd">Head</h1>
          <div class="fooga wooga bd">
              <p class="{bool ? "text" : "active" }">Text</p>
          </div>
      </div>

      121 |         );
      122 | 
    > 123 |         expect(processed.toString()).toMatchSnapshot();
          |                                      ^
      124 | 
      125 |         const output = await processor.output();
      126 | 

      at toMatchSnapshot (packages/svelte/test/svelte.test.js:123:38)

  ● /svelte.js › should extract CSS from a <link> tag (single quotes)

    expect(received).toMatchSnapshot()

    Snapshot name: `/svelte.js should extract CSS from a <link> tag (single quotes) 1`

    - Snapshot
    + Received

    @@ -1,7 +1,6 @@
    - "
    - <div class="flex wrapper">
    + "<div class="flex wrapper">
          <h1 class="flex fooga hd">Head</h1>
          <div class="fooga wooga bd">
              <p class="{bool ? "text" : "active" }">Text</p>
          </div>
      </div>

      121 |         );
      122 | 
    > 123 |         expect(processed.toString()).toMatchSnapshot();
          |                                      ^
      124 | 
      125 |         const output = await processor.output();
      126 | 

      at toMatchSnapshot (packages/svelte/test/svelte.test.js:123:38)

  ● /svelte.js › should extract CSS from a <link> tag (unquoted)

    expect(received).toMatchSnapshot()

    Snapshot name: `/svelte.js should extract CSS from a <link> tag (unquoted) 1`

    - Snapshot
    + Received

    @@ -1,7 +1,6 @@
    - "
    - <div class="flex wrapper">
    + "<div class="flex wrapper">
          <h1 class="flex fooga hd">Head</h1>
          <div class="fooga wooga bd">
              <p class="{bool ? "text" : "active" }">Text</p>
          </div>
      </div>

      121 |         );
      122 | 
    > 123 |         expect(processed.toString()).toMatchSnapshot();
          |                                      ^
      124 | 
      125 |         const output = await processor.output();
      126 | 

      at toMatchSnapshot (packages/svelte/test/svelte.test.js:123:38)

  ● /svelte.js › should extract CSS from a <link> tag (values)

    expect(received).toMatchSnapshot()

    Snapshot name: `/svelte.js should extract CSS from a <link> tag (values) 1`

    - Snapshot
    + Received

    @@ -1,7 +1,6 @@
    - "
    - <div
    + "<div
          data-simple="color: #BEEFED"
          data-expression="{"color: " + "#BEEFED"}"
          data-template="{`color: ${"#BEEFED"}`}"
      >
      </div>

      121 |         );
      122 | 
    > 123 |         expect(processed.toString()).toMatchSnapshot();
          |                                      ^
      124 | 
      125 |         const output = await processor.output();
      126 | 

      at toMatchSnapshot (packages/svelte/test/svelte.test.js:123:38)

  ● /svelte.js › should handle errors: invalid reference <script> - <link>

    expect(received).toMatchSnapshot()

    Snapshot name: `/svelte.js should handle errors: invalid reference <script> - <link> 3`

    - Snapshot
    + Received

    @@ -1,7 +1,6 @@
    - "
    - <h2 class="yup">Yup</h2>
    + "<h2 class="yup">Yup</h2>
      
      <script>
      import css from "./invalid.css";

      183 |         expect(warnSpy.mock.calls).toMatchSnapshot();
      184 | 
    > 185 |         expect(processed.toString()).toMatchSnapshot();
          |                                      ^
      186 |     });
      187 | 
      188 |     it("should throw on both <style> and <link> in one file", async () => {

        
        
      at toMatchSnapshot (packages/svelte/test/svelte.test.js:185:38)

  ● /svelte.js › should handle errors: invalid reference template - <link>

    expect(received).toMatchSnapshot()

    Snapshot name: `/svelte.js should handle errors: invalid reference template - <link> 3`

    - Snapshot
    + Received

    - "
    - <h1 class="{"css.nope"}">Nope</h1>
    + "<h1 class="{"css.nope"}">Nope</h1>
      <h2 class="yup">Yup</h2>
      <h3 class="{"css.stillnope"}">Still Nope</h3>
      <script>import css from "./invalid.css";</script>"

      183 |         expect(warnSpy.mock.calls).toMatchSnapshot();
      184 | 
    > 185 |         expect(processed.toString()).toMatchSnapshot();
          |                                      ^
      186 |     });
      187 | 
      188 |     it("should throw on both <style> and <link> in one file", async () => {

      at toMatchSnapshot (packages/svelte/test/svelte.test.js:185:38)

  ● /svelte.js › should handle errors: empty css file - <link>

    expect(received).toMatchSnapshot()

    Snapshot name: `/svelte.js should handle errors: empty css file - <link> 3`

    - Snapshot
    + Received

    - "
    - <div class="{"css.nope"}">NOPE</div>
    + "<div class="{"css.nope"}">NOPE</div>
      <div class="{"css.alsonope"}">STILL NOPE</div>
      <script>import css from "./empty.css";</script>"

      183 |         expect(warnSpy.mock.calls).toMatchSnapshot();
      184 | 
    > 185 |         expect(processed.toString()).toMatchSnapshot();
          |                                      ^
      186 |     });
      187 | 
      188 |     it("should throw on both <style> and <link> in one file", async () => {

      at toMatchSnapshot (packages/svelte/test/svelte.test.js:185:38)


Snapshot Summary
 › 10 snapshots failed from 1 test suite. Inspect your code changes or run `npm test -- -u` to update them.

Test Suites: 1 failed, 76 skipped, 143 passed, 144 of 220 total
Tests:       10 failed, 80 skipped, 377 passed, 467 total
Snapshots:   10 failed, 302 passed, 312 total
Time:        31.598s
Ran all test suites in 2 projects.
npm ERR! Test failed.  See above for more details.
TravisBuddy Request Identifier: de10d880-6b5c-11e9-9dda-bbc728ae4625
@codecov

This comment has been minimized.

Copy link

commented Apr 30, 2019

Codecov Report

Merging #580 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #580      +/-   ##
=========================================
+ Coverage    98.9%   98.9%   +<.01%     
=========================================
  Files          47      47              
  Lines        1188    1191       +3     
  Branches      183     183              
=========================================
+ Hits         1175    1178       +3     
  Misses         13      13
Impacted Files Coverage Δ
packages/test-utils/write.js 100% <100%> (ø) ⬆️
packages/svelte/svelte.js 100% <100%> (ø) ⬆️

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 fcca834...42afc5d. Read the comment docs.

@tivac tivac merged commit 831ed50 into master Apr 30, 2019

6 of 9 checks passed

Header rules No header rules processed
Details
Pages changed All files already uploaded
Details
Redirect rules No redirect rules processed
Details
Mixed content No mixed content detected
Details
codecov/patch 100% of diff hit (target 98.9%)
Details
codecov/project 98.9% (+<.01%) compared to fcca834
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details

@tivac tivac deleted the rollup-svelte-watching-composes branch Apr 30, 2019

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.