Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 5.8k
Jest + Playwright Testing#1276
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
6eb7c90f299c267e6a7b0c35aea508e1bbfa8c5cb75229727045e91e83fd5fdf704f0b25747d6e0dffb6efab9522c7e66d36c5c33e8da21daed09be3ce73f12b7c54f1ab3de2d167031251119c6dab0e2359ead41adceacff1a9f6b73f86338b01355cf9e83734a25747dc27aadb9862e0e7153fe9f7c6181f6e7154540c7e12c5ab2fe355aafca2aa62098bc1aa72b3cb7dbbc570757e05aa3ea26aae9f5aed8a34c6c04b50385cb407a1cba80d56dfa5b54456ed6d2b521aaa91634e5b5c8954659b4b9be0ffcefead4017628a68b2a40f45937cdcc64d079754cf9cbc56977bd915607ef151ef4e7398903cba1c75d818f21d5e8c9aef7ee87b2362b3ab99e27b99e2e8c127068b19a894851f05432265375c377e3c9d18183adcf3f6127b6b6e99cfcc43ad6c1895aaa259862bcc9667ed6c80a38730d402d6cf45c2b315226fd871d467b320b079d141b90edd8471576f94cfbe04275fa6170d1451dedca07209ce4f512762dc5e2335b64eb8ba099160a6fb8092da83e37b71b6564e29894be2845f3f357c08261484fec434da3645297399e4e4887ae10e0e804cbfc0a79aeaa9473bb5a2440a0c9f5e562f6c34f80983d535ccea9daf715531c365fb4623677befa408d58b3adFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -3,9 +3,8 @@ packages/docsify-server-renderer/build.js | ||
| node_modules | ||
| build | ||
| server.js | ||
| cypress | ||
| lib | ||
| themes | ||
| build | ||
| docs/ | ||
| **/*.md | ||
| **/*.md | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -6,7 +6,6 @@ module.exports = { | ||
| ecmaVersion: 2019, | ||
| }, | ||
| env: { | ||
| jest: true, | ||
| browser: true, | ||
| node: true, | ||
| es6: true, | ||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,31 +1,30 @@ | ||
| name: Linting Checks | ||
| name: Lint | ||
| on: | ||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| - develop | ||
| branches: | ||
| - master | ||
| - develop | ||
| pull_request: | ||
| branches: | ||
| - master | ||
| - develop | ||
| branches: | ||
| - master | ||
| - develop | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-16.04 | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| node-version: [10.x, 12.x, 13.x] | ||
| node-version: [12.x, 14.x] | ||
| steps: | ||
| - uses: actions/checkout@v1 | ||
| - name: Use Node.js ${{ matrix.node-version }} | ||
| uses: actions/setup-node@v1 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| - name: bootstrap | ||
| run: npm run bootstrap | ||
| - name: Build | ||
| run: npm run build | ||
| - name: Linting | ||
| run: npm run lint | ||
| - uses: actions/checkout@v2 | ||
| - name: Use Node.js ${{ matrix.node-version }} | ||
| uses: actions/setup-node@v1 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| - name: Install | ||
| run: npm i --ignore-scripts | ||
| - name: Lint | ||
| run: npm run lint |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| name: Build & Test | ||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| - develop | ||
| pull_request: | ||
| branches: | ||
| - master | ||
| - develop | ||
| jobs: | ||
| build: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| node-version: [12.x, 14.x] | ||
| os: ['macos-latest', 'ubuntu-latest', 'windows-latest'] | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Use Node.js ${{ matrix.node-version }} | ||
| uses: actions/setup-node@v1 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| - name: bootstrap | ||
| run: npm run bootstrap | ||
| - name: unit tests | ||
| run: npm run test:unit -- -ci --runInBand | ||
| - name: integration tests | ||
| run: npm run test:integration -- -ci --runInBand | ||
| - uses: microsoft/playwright-github-action@v1.3.0 | ||
| - name: e2e tests | ||
| run: npm run test:e2e -- --ci --runInBand | ||
| - name: Upload artifacts (diff output) | ||
| uses: actions/upload-artifact@v2 | ||
| if: failure() | ||
| with: | ||
| name: ${{ matrix.os }}-${{ matrix.node-version }}-diff-output | ||
| path: ${{ github.workspace }}/test/**/__diff_output__/* |
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,10 @@ | ||
| *.log | ||
| .DS_Store | ||
| .idea | ||
| __diff_output__ | ||
| lib/ | ||
| node_modules | ||
| /themes/ | ||
| /lib/ | ||
| /cypress/integration/examples | ||
| /cypress/fixtures/docs | ||
| themes/ | ||
| # exceptions | ||
| !.gitkeep |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| { | ||
| // Use IntelliSense to learn about possible attributes. | ||
| // Hover to view descriptions of existing attributes. | ||
| // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
| "version": "0.2.0", | ||
| "configurations": [ | ||
| { | ||
| "type": "node", | ||
| "request": "launch", | ||
| "name": "Run tests", | ||
| "runtimeExecutable": "npm", | ||
| "runtimeArgs": ["run-script", "test"], | ||
| "console": "integratedTerminal" | ||
| }, | ||
| { | ||
| "type": "node", | ||
| "request": "launch", | ||
| "name": "Run current test file", | ||
| "runtimeExecutable": "npm", | ||
| "runtimeArgs": ["run-script", "test"], | ||
| "args": ["--", "-i", "${relativeFile}", "--testPathIgnorePatterns"], | ||
| "console": "integratedTerminal" | ||
| }, | ||
| { | ||
| "type": "node", | ||
| "request": "launch", | ||
| "name": "Run selected test name", | ||
| "runtimeExecutable": "npm", | ||
| "runtimeArgs": ["run-script", "test"], | ||
| "args": [ | ||
| "--", | ||
| "-i", | ||
| "${relativeFile}", | ||
| "-t", | ||
| "${selectedText}", | ||
| "--testPathIgnorePatterns" | ||
| ], | ||
| "console": "integratedTerminal" | ||
| }, | ||
| { | ||
| "type": "node", | ||
| "request": "launch", | ||
| "name": "Update current test file snapshot(s)", | ||
| "runtimeExecutable": "npm", | ||
| "runtimeArgs": ["run-script", "test"], | ||
| "args": [ | ||
| "--", | ||
| "-i", | ||
| "${relativeFile}", | ||
| "--updateSnapshot", | ||
| "--testPathIgnorePatterns" | ||
| ], | ||
| "console": "integratedTerminal" | ||
| }, | ||
| { | ||
| "type": "node", | ||
| "request": "launch", | ||
| "name": "Update selected test name snapshot(s)", | ||
| "runtimeExecutable": "npm", | ||
| "runtimeArgs": ["run-script", "test"], | ||
| "args": [ | ||
| "--", | ||
| "-i", | ||
| "${relativeFile}", | ||
| "-t", | ||
| "${selectedText}", | ||
| "--updateSnapshot", | ||
| "--testPathIgnorePatterns" | ||
| ], | ||
| "console": "integratedTerminal" | ||
| } | ||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| module.exports = { | ||
| presets: [ | ||
| [ | ||
| '@babel/preset-env', | ||
| { | ||
| targets: { | ||
| node: 'current', | ||
| }, | ||
| }, | ||
| ], | ||
| ], | ||
| }; |
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to keep this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's default text created by VSCode when a new launch.json file is created (I didn't write it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I don't use vscode, I use JetBrains's
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should not commit this file. The
.ideafolder is currently ignored, which serves the same purpose as.vscodebut for JetBrains IntelliJ users.This file may vary from user to user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@trusktr -- Standardizing debug configurations for IDEs is more akin to standardizing NPM and CI scripts than user preferences. Developers don't want to type
./node_modules/.bin/someBinary -a arg1 -b arg2 -c var3for frequently run tasks, so we simplify by usingnpm run something. Similarly, I don't want to typenpm run tests:jest -- -i /path/to/file.test.js -t "name of describe of test block"just to run a single test, so running a debug script from the context of a file (so I don't have to type the path) and/or with a test name selected (so I don't have to type the test name) means I can just press a button to run a single test, making testing easier and more efficient. Win win.There is no reason to omit these kinds of project-specific files from the repo because they should not vary between users. That's the whole purpose behind storing their configuration as files that can be managed by source control instead of storing them as user/app preferences. They should be managed like any other change to the project: users can add/modify them, submit changes as PRs, then they are reviewed and (hopefully) merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Someone may not want to run in
integratedTerminalfor example. Maybe VS Code shouldn't mix personal configs with actually-useful/convenient project configs. Not sure why they do that. F.e. why should the software project dictate if the test runs inintegratedTerminalor not?But I do see the convenience (choose a file, highlight text with cursor, hit the button and it runs only that test). No harm in keeping it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can ensure the project's required steps (f.e.
npm test) are not in an editor-specific config (which is currently the case), and reserve the editor configs for conveniences only.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@trusktr --
Agreed on not putting anything critical in editor-specific scripts/configs. These are convenience only. If folks using webstorm for example want to check in the
.ideafolder, that's fine with me as long as I won't be required to use webstorm to perform some critical function (and you don't do something silly like force an editor theme on everyone else).As for integrated vs external terminals, this is where I think individuals are free to modify files in their local dev environment and tell git to ignore their own changes to those files. I went with the integrated terminal because it's the default selection and it seems the least intrusive, but folks can change it locally (or if everyone wants to use an external terminal, just file PR and we'll discuss).