Skip to content

Commit

Permalink
feat: confirm the expected generated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Oct 12, 2021
1 parent e96672e commit c45aefb
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ jobs:

- name: Cypress tests 🧪
uses: cypress-io/github-action@v2
with:
# use a custom command to conform all expected tests
# were correctly generated
# using https://www.npmjs.com/package/cypress-expect
command: npm test

- name: Semantic Release 🚀
uses: cycjimmy/semantic-release-action@v2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
cypress/videos/
28 changes: 28 additions & 0 deletions cypress/expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"A": {
"checks out for A": "passed"
},
"1": {
"checks out for 1": "passed"
},
"using it.each": {
"checks A": "passed",
"checks 1": "passed",
"capital letter A !== a": "passed"
},
"has expected values": {
"A = A": "passed",
"1 = 1": "passed",
"capital letter A !== a": "passed"
},
"add()": {
"adds 1 and 1 then returns 2": "passed",
"adds 2 and -2 then returns 0": "passed",
"adds 140 and 48 then returns 188": "passed",
"with invalid arguments": {
"adds 1 and \"foo\" then returns NaN": "passed",
"adds null and 10 then returns NaN": "passed",
"adds {} and [] then returns NaN": "passed"
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"src"
],
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"test": "cypress-expect run --expect cypress/expected.json",
"semantic-release": "semantic-release"
},
"keywords": [],
Expand Down

0 comments on commit c45aefb

Please sign in to comment.