Skip to content

test(e2e): fix DevServer test #3096

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

Merged
merged 5 commits into from
Mar 20, 2021
Merged

Conversation

ylemkimon
Copy link
Contributor

  • This is a bugfix
  • This is a feature
  • This is a code refactor
  • This is a test update
  • This is a docs update
  • This is a metadata update

For Bugs and Features; did you add new tests?

N/A

Motivation / Use-Case

testBin sets the config path if the second argument is not provided:

function testBin(testArgs, configPath) {
const cwd = process.cwd();
const env = process.env.NODE_ENV;
if (!configPath) {
configPath = basicConfigPath;

If the config path is set via the first argument (testArgs), it'll result in multiple config paths, leading to flaky tests and invalid results, e.g.:

  ● DevServer › should supports entry as descriptor

    expect(received).toContain(expected) // indexOf

    Expected substring: "foo.js"
    Received string:    ""

      52 |       .then((output) => {
      53 |         expect(output.exitCode).toEqual(0);
    > 54 |         expect(output.stdout).toContain('foo.js');
         |                               ^
      55 |         done();
      56 |       })
      57 |       .catch(done);

      at test/e2e/DevServer.test.js:54:31
          at runMicrotasks (<anonymous>)

Breaking Changes

N/A

Additional Info

@codecov
Copy link

codecov bot commented Mar 19, 2021

Codecov Report

Merging #3096 (e4e4680) into master (1dde662) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3096   +/-   ##
=======================================
  Coverage   92.30%   92.30%           
=======================================
  Files          37       37           
  Lines        1261     1261           
  Branches      328      328           
=======================================
  Hits         1164     1164           
  Misses         92       92           
  Partials        5        5           

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 1dde662...e4e4680. Read the comment docs.

Copy link
Member

@snitin315 snitin315 left a comment

Choose a reason for hiding this comment

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

Thanks!

@snitin315 snitin315 merged commit d11298a into webpack:master Mar 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants