diff --git a/.devcontainer/opinion-ate.steps.txt b/.devcontainer/opinion-ate.steps.txt index 46b33bf..581d733 100644 --- a/.devcontainer/opinion-ate.steps.txt +++ b/.devcontainer/opinion-ate.steps.txt @@ -2,4 +2,20 @@ === [opinion-ate steps] ================================================================================ -https://outsidein.dev/vue/2-project-setup.html#setting-up-development-environment \ No newline at end of file +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 + diff --git a/client/package.json b/client/package.json index 3e89014..a0bd553 100644 --- a/client/package.json +++ b/client/package.json @@ -39,5 +39,21 @@ "vue-cli-service lint", "git add" ] + }, + "jest": { + "testEnvironment": "node", + "modulePaths": [ + "/src", + "/node_modules" + ], + "testPathIgnorePatterns": [ + ".git/.*", + "node_modules/.*", + "src/.*" + ], + "transformIgnorePatterns": [ + "node_modules/.*", + ".*\\.js" + ] } } diff --git a/client/tests/unit/example.spec.js b/client/tests/unit/example.spec.js index fa8bf92..2cfc6af 100644 --- a/client/tests/unit/example.spec.js +++ b/client/tests/unit/example.spec.js @@ -7,6 +7,7 @@ describe('HelloWorld.vue', () => { const wrapper = shallowMount(HelloWorld, { propsData: {msg}, }); + expect(wrapper.text()).toMatch(msg); }); });