Skip to content

Commit

Permalink
Jest-Vue-Serializer-TJW
Browse files Browse the repository at this point in the history
  • Loading branch information
TheJaredWilcurt authored Jan 19, 2020
2 parents 714c585 + bae2d77 commit be3c9e1
Show file tree
Hide file tree
Showing 7 changed files with 2,134 additions and 1,244 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ NW.js + Vue-CLI 4 example
* A11Y Linting
* Jest Linting
* Jest (100% test coverage)
* Jest Serializer Vue (TJW)

*Why not include Vue-Router or Vuex?*

Expand Down Expand Up @@ -83,7 +84,9 @@ This will download the source code for the latest version of Vue-DevTools and do
This is not for those *using* this repo, but for those *maintaining* it.

1. When updating the version of NW.js devDependency, also update these:
* `package.json` devDeps, build nwVersion
* `tests/unit/setup.js`
* `tests/unit/components/__snapshots__/HelloWorld.test.js.snap`
* `.browserslistrc`
1. Bump the version number, and all the npm scripts that reference the version number
1. Run `npm run regression` after updating dependencies or other major changes to verify builds still work correctly
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = {
'<rootDir>/tests/unit/setup.js'
],
snapshotSerializers: [
'<rootDir>/tests/unit/serializer.js'
'<rootDir>/node_modules/jest-serializer-vue-tjw'
],
testEnvironment: 'jest-environment-jsdom-global',
testMatch: [
Expand Down
3,283 changes: 2,105 additions & 1,178 deletions package-lock.json

Large diffs are not rendered by default.

35 changes: 18 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"To turn spell checking off, remove it from the chromium-args in this file"
],
"name": "nw-vue",
"version": "1.3.0",
"version": "1.4.0",
"main": "http://localhost:8964",
"node-remote": "http://localhost:8964",
"node-main": "",
Expand All @@ -27,10 +27,10 @@
"build:nw": "build --concurrent --tasks win-x86,linux-x86,linux-x64,mac-x64 --mirror https://dl.nwjs.io/ .",
"build:win": "npm run build:win:clean && npm run build:vue && build --tasks win-x86 --mirror https://dl.nwjs.io/ .",
"build:lin": "npm run build:lin:clean && npm run build:vue && build --tasks linux-x64 --mirror https://dl.nwjs.io/ .",
"build:win:clean": "rimraf ./dist-vue ./dist/nw-vue-1.3.0-win-x86 ./dist/nw-vue-1.3.0-win-x86.zip ./dist/nw-vue-1.3.0-win-x86.7z ./dist/nw-vue-1.3.0-win-x86-Setup.exe",
"build:lin:clean": "rimraf ./dist-vue ./dist/nw-vue-1.3.0-linux-x64 ./dist/nw-vue-1.3.0-linux-x64.zip",
"run:win": "dist\\nw-vue-1.3.0-win-x86\\nw-vue.exe",
"run:lin": "./dist/nw-vue-1.3.0-linux-x64/nw-vue",
"build:win:clean": "rimraf ./dist-vue ./dist/nw-vue-1.4.0-win-x86 ./dist/nw-vue-1.4.0-win-x86.zip ./dist/nw-vue-1.4.0-win-x86.7z ./dist/nw-vue-1.4.0-win-x86-Setup.exe",
"build:lin:clean": "rimraf ./dist-vue ./dist/nw-vue-1.4.0-linux-x64 ./dist/nw-vue-1.4.0-linux-x64.zip",
"run:win": "dist\\nw-vue-1.4.0-win-x86\\nw-vue.exe",
"run:lin": "./dist/nw-vue-1.4.0-linux-x64/nw-vue",
"regression": "rd /s /q node_modules & rd /s /q node_modules & rd /s /q node_modules & npm install && npm run lint && npm test && npm run build:win && npm run run:win",
"lint": "vue-cli-service lint --no-fix",
"fix": "vue-cli-service lint --fix",
Expand All @@ -44,11 +44,11 @@
"express": "^4.17.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.1.1",
"@vue/cli-plugin-e2e-nightwatch": "^4.1.1",
"@vue/cli-plugin-eslint": "^4.1.1",
"@vue/cli-plugin-unit-jest": "^4.1.1",
"@vue/cli-service": "^4.1.1",
"@vue/cli-plugin-babel": "^4.1.2",
"@vue/cli-plugin-e2e-nightwatch": "^4.1.2",
"@vue/cli-plugin-eslint": "^4.1.2",
"@vue/cli-plugin-unit-jest": "^4.1.2",
"@vue/cli-service": "^4.1.2",
"@vue/test-utils": "1.0.0-beta.29",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "^10.0.3",
Expand All @@ -59,30 +59,31 @@
"babel-preset-stage-2": "^6.24.1",
"babel-preset-vue-app": "^2.0.0",
"concurrently": "^5.0.2",
"core-js": "^3.6.1",
"core-js": "^3.6.4",
"eslint": "^6.8.0",
"eslint-config-tjw-base": "^1.0.0",
"eslint-config-tjw-vue": "^1.0.0",
"eslint-plugin-jest": "^23.1.1",
"eslint-plugin-vue": "^6.0.2",
"eslint-plugin-jest": "^23.6.0",
"eslint-plugin-vue": "^6.1.2",
"eslint-plugin-vue-a11y": "^0.0.31",
"jest": "^24.9.0",
"jest-environment-jsdom": "^24.9.0",
"jest-environment-jsdom-global": "^1.2.0",
"jest-serializer-vue-tjw": "^3.3.0",
"jest-transform-stub": "^2.0.0",
"nw": "0.43.2-sdk",
"nw": "0.43.6-sdk",
"nw-vue-devtools-prebuilt": "^0.0.10",
"nwjs-builder-phoenix": "^1.15.0",
"nwjs-types": "^1.0.0",
"rimraf": "^3.0.0",
"vue": "^2.6.11",
"vue-jest": "^3.0.5",
"vue-template-compiler": "^2.6.11",
"wait-on": "^3.3.0"
"wait-on": "^4.0.0"
},
"chromium-args": "--enable-spell-checking --load-extension='./node_modules/nw-vue-devtools-prebuilt/extension'",
"build": {
"nwVersion": "v0.43.2",
"nwVersion": "v0.43.6",
"nwFlavor": "normal",
"targets": [
"zip",
Expand Down Expand Up @@ -131,7 +132,7 @@
"height": 600,
"min_width": 700,
"min_height": 500,
"icon": "dist-vue/vue.png"
"icon": "dist-vue/icon.png"
}
},
"win": {
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/components/__snapshots__/HelloWorld.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ exports[`HelloWorld.vue Render default contents 1`] = `
<h3>
You are using
Vue.js (v2.6.11),
NW.js (v0.43.2-sdk),
Node.js (v13.5.0),
NW.js (v0.43.6-sdk),
Node.js (v13.6.0),
and
Chromium (v79.0.3945.88).
Chromium (v79.0.3945.130).
</h3>
<button>
Show
Expand Down
42 changes: 0 additions & 42 deletions tests/unit/serializer.js

This file was deleted.

7 changes: 4 additions & 3 deletions tests/unit/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ window.getComputedStyle = function getComputedStyleStub (el) {

global.beforeEach(() => {
window.process = {
cwd: process.cwd,
env: {
NODE_ENV: 'development'
},
versions: {
chromium: '79.0.3945.88',
nw: '0.43.2',
chromium: '79.0.3945.130',
nw: '0.43.6',
'nw-flavor': 'sdk',
node: '13.5.0'
node: '13.6.0'
}
};
window.nw = {
Expand Down

0 comments on commit be3c9e1

Please sign in to comment.