- Notifications
You must be signed in to change notification settings - Fork2.1k
Adding Tests#355
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Open
liron-navon wants to merge11 commits intovuejs:masterChoose a base branch fromliron-navon:tests
base:master
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Uh oh!
There was an error while loading.Please reload this page.
Open
Adding Tests#355
Changes fromall commits
Commits
Show all changes
11 commits Select commitHold shift + click to select a range
f08822e
made tests
7d1c773
fixed circleci
9a2dba7
changed image version
744dc78
refactored the snapshot tests to add more content
30a8e9f
added more e2e tests
947a3a9
returned e2e to headless mode
425c58d
regenerated snapshots
ec30be9
removed time from snapshot
5eb871e
added Item.spec.js
96e5dd3
added coverage
ee4d157
added tests for filters
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
9 changes: 8 additions & 1 deletion.babelrc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions.circleci/config.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
version: 2 | ||
jobs: | ||
build: | ||
docker: | ||
- image: circleci/node:11.8-browsers | ||
steps: | ||
- checkout # special step to check out source code to working directory | ||
- restore_cache: # special step to restore the dependency cache | ||
key: dependency-cache-{{ checksum "package.json" }} | ||
- run: | ||
name: install npm dependencies | ||
command: npm install | ||
- save_cache: # special step to save the dependency cache | ||
key: dependency-cache-{{ checksum "package.json" }} | ||
paths: | ||
- ./node_modules | ||
- run: | ||
name: starting a development server | ||
command: npm run dev | ||
background: true | ||
- run: | ||
name: waiting for server to be responsive (for e2e) | ||
command: | | ||
while ! nc -z localhost 8080; do | ||
sleep 0.1 # wait for 1/10 of the second before check again | ||
done | ||
- run: | ||
name: running unit tests | ||
command: npm run test:unit | ||
- run: | ||
name: running end to end tests | ||
command: npm run test:e2e |
36 changes: 36 additions & 0 deletionsjest.config.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
module.exports = { | ||
// we can actually use "@/components/item.vue" to access components in a simple way | ||
moduleNameMapper: { | ||
"^@/(.*)$": "<rootDir>/src/$1", | ||
// the 'create-api' is defined in webpack | ||
"^create-api$": '<rootDir>/src/api/create-api-client.js', | ||
}, | ||
// the file types we want jest to accept | ||
moduleFileExtensions: [ | ||
"js", | ||
"json", | ||
// tell Jest to handle `*.vue` files | ||
"vue" | ||
], | ||
// transformations we want jest to apply | ||
transform: { | ||
// process `*.vue` files with `vue-jest` | ||
".*\\.(vue)$": "vue-jest", | ||
// process js files with jest | ||
"^.+\\.js$": "<rootDir>/node_modules/babel-jest", | ||
// process assets with transform stub | ||
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub', | ||
}, | ||
// we will use this to create snapshot tests | ||
snapshotSerializers: [ | ||
'jest-serializer-vue', | ||
], | ||
// used for jsdom to mimic a real browser with a real url | ||
testURL: 'http://localhost/', | ||
// we should collect coverage | ||
collectCoverage: true, | ||
// set a directory for coverage cache | ||
coverageDirectory: '<rootDir>/__coverage__', | ||
// set patterns to ignore for coverate (["/node_modules/"]) is the default value | ||
coveragePathIgnorePatterns: ["/node_modules/"] | ||
}; |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.