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

Cannot update snapshots #2357

Closed
sramam opened this issue Jan 10, 2020 · 3 comments · Fixed by #2359
Closed

Cannot update snapshots #2357

sramam opened this issue Jan 10, 2020 · 3 comments · Fixed by #2359
Labels
bug current functionality does not work as desired
Milestone

Comments

@sramam
Copy link
Contributor

sramam commented Jan 10, 2020

I am trying out ava@3.0.0-beta.1 and noticed that update-snapshots is broken.
The tests run, but the snapshots are not updated, and it reports a snapshot mismatch failure.

Config

Copy the relevant section from package.json:

"ava": {
    "files": [
      "dist/**/test.js",
      "dist/**/test/**/*.js",
      "!dist/**/test/fixtures/**/*.js",
      "!dist/**/helpers/**"
    ],
    "serial": false,
    "ignoredByWatcher": [
      "dist/**/*.js"
    ]
  }

Command-Line Arguments

I upgraded @types/node, per #2332

-    "@types/node": "^12.12.24",
-    "ava": "^2.4.0",
+    "@types/node": "^13.1.6",
+    "ava": "3.0.0-beta.1",

& "sources" -> "ignoredByWatcher" per the warning reported.

Environment

$ npx ava --version
3.0.0-beta.1
@novemberborn
Copy link
Member

The tests run, but the snapshots are not updated, and it reports a snapshot mismatch failure.

How are you running the tests? By default, snapshots aren't updated. But perhaps we broke something in how you're telling AVA to update them.


& "sources" -> "ignoredByWatcher" per the warning reported.

Note though that this "ignored by watcher" is the inverse of sources. Your configuration now says to ignore all JS files in dist which is probably not what you intended.

@novemberborn novemberborn added bug current functionality does not work as desired question labels Jan 10, 2020
@novemberborn novemberborn added this to the v3 milestone Jan 10, 2020
@sramam
Copy link
Contributor Author

sramam commented Jan 10, 2020

Here's a minimal reproduction

@novemberborn
Copy link
Member

Ah! There's a typo in lib/cli.js:

ava/lib/cli.js

Line 163 in 090884b

combined.updateSnaphots = argv[flag];

@novemberborn novemberborn changed the title 3.0.0-beta.1 update-snapshots is broken Cannot update snapshots Jan 12, 2020
sramam added a commit to sramam/ava that referenced this issue Jan 12, 2020
novemberborn pushed a commit that referenced this issue Jan 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug current functionality does not work as desired
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants