Skip to content

Commit

Permalink
try configuring jest to run faster
Browse files Browse the repository at this point in the history
  • Loading branch information
incatrex committed Aug 12, 2021
1 parent af7a482 commit 0aba983
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .devcontainer/opinion-ate.steps.txt
Expand Up @@ -2,4 +2,20 @@
=== [opinion-ate steps]
================================================================================

https://outsidein.dev/vue/2-project-setup.html#setting-up-development-environment
https://outsidein.dev/vue/2-project-setup.html#setting-up-development-environment


1. create app
vue create opinion-ate

2. set up autoformatting and linting
yarn lint

3. run tests
yarn test:unit

# tried to improve test performance per these links:
https://stackoverflow.com/questions/45087018/jest-simple-tests-are-slow
https://itnext.io/how-to-make-your-sluggish-jest-v23-tests-go-faster-1d4f3388bcdd
https://github.com/facebook/jest/issues/7963

16 changes: 16 additions & 0 deletions client/package.json
Expand Up @@ -39,5 +39,21 @@
"vue-cli-service lint",
"git add"
]
},
"jest": {
"testEnvironment": "node",
"modulePaths": [
"<rootDir>/src",
"<rootDir>/node_modules"
],
"testPathIgnorePatterns": [
".git/.*",
"node_modules/.*",
"src/.*"
],
"transformIgnorePatterns": [
"node_modules/.*",
".*\\.js"
]
}
}
1 change: 1 addition & 0 deletions client/tests/unit/example.spec.js
Expand Up @@ -7,6 +7,7 @@ describe('HelloWorld.vue', () => {
const wrapper = shallowMount(HelloWorld, {
propsData: {msg},
});

expect(wrapper.text()).toMatch(msg);
});
});

0 comments on commit 0aba983

Please sign in to comment.