Skip to content

Commit d2e6857

Browse files
committed
test: use fixture to avoid out of sync snapshot
1 parent 7d074c3 commit d2e6857

File tree

4 files changed

+75
-2
lines changed

4 files changed

+75
-2
lines changed

test/fixtures/fixture.json

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"name": "prettier-plugin-package",
3+
"version": "0.1.1",
4+
"description": "An opinionated package.json formatter plugin for Prettier",
5+
"license": "MPL-2.0",
6+
"repository": "shellscape/prettier-plugin-package",
7+
"author": "shellscape",
8+
"homepage": "https://github.com/shellscape/prettier-plugin-package",
9+
"bugs": "https://github.com/shellscape/prettier-plugin-package/issues",
10+
"main": "lib/index.js",
11+
"engines": {
12+
"node": ">= 8.0.0"
13+
},
14+
"scripts": {
15+
"ci:coverage": "nyc npm run ci:test && nyc report --reporter=text-lcov > coverage.lcov",
16+
"ci:lint": "npm run lint && npm run security",
17+
"ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
18+
"ci:test": "npm run test -- --verbose",
19+
"commitlint": "commitlint",
20+
"commitmsg": "commitlint -e $GIT_PARAMS",
21+
"lint": "eslint --fix --cache lib test && prettier --write package.json",
22+
"lint-staged": "lint-staged",
23+
"prepublishOnly": "npm run lint",
24+
"security": "npm audit",
25+
"test": "ava"
26+
},
27+
"files": [
28+
"lib/",
29+
"README.md",
30+
"LICENSE"
31+
],
32+
"keywords": [
33+
"package",
34+
"package.json",
35+
"plugin",
36+
"prettier"
37+
],
38+
"peerDependencies": {
39+
"prettier": "^1.18.2"
40+
},
41+
"dependencies": {},
42+
"devDependencies": {
43+
"@commitlint/cli": "^8.1.0",
44+
"@commitlint/config-conventional": "^8.1.0",
45+
"ava": "^2.2.0",
46+
"eslint-config-shellscape": "^2.0.2",
47+
"execa": "^2.0.3",
48+
"lint-staged": "^9.2.0",
49+
"nyc": "^14.1.0",
50+
"pre-commit": "^1.2.2",
51+
"prettier": "^1.18.2"
52+
},
53+
"ava": {
54+
"files": [
55+
"!**/fixtures/**"
56+
]
57+
},
58+
"lint-staged": {
59+
"*.js": [
60+
"eslint --fix",
61+
"git add"
62+
]
63+
},
64+
"nyc": {
65+
"include": [
66+
"lib/*.js"
67+
],
68+
"exclude": [
69+
"test/"
70+
]
71+
},
72+
"pre-commit": "lint-staged"
73+
}

test/snapshots/test.js.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Generated by [AVA](https://ava.li).
1010
1111
`{␊
1212
"name": "prettier-plugin-package",␊
13-
"version": "0.1.0",␊
13+
"version": "0.1.1",␊
1414
"description": "An opinionated package.json formatter plugin for Prettier",␊
1515
"license": "MPL-2.0",␊
1616
"repository": "shellscape/prettier-plugin-package",␊

test/snapshots/test.js.snap

5 Bytes
Binary file not shown.

test/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const { join } = require('path');
33
const test = require('ava');
44
const prettier = require('prettier');
55

6-
const pkg = require('../package.json');
6+
const pkg = require('./fixtures/fixture.json');
77

88
const shuffle = (arr) => {
99
const result = arr.slice();

0 commit comments

Comments
 (0)