Added testing framework and updated dependencies.

This commit is contained in:
2020-12-15 20:32:30 +01:00
parent 214daeb851
commit 07b3831d31
5 changed files with 5501 additions and 1155 deletions

View File

@@ -2,15 +2,19 @@
A browser game inspired by Breach Protocol from Cyberpunk 2077.
## Run in development mode
## Building the project
```
// run once to install all dependencies
npm i
// run all tests
npm run test
// run the server for local development
npm run serve
```
### Build for production
```
// build for production
npm run build
```

6584
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -5,23 +5,42 @@
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
"lint": "vue-cli-service lint",
"test": "jest"
},
"jest": {
"moduleFileExtensions": [
"js",
"ts",
"json",
"vue"
],
"transform": {
".*\\.(vue)$": "vue-jest",
"^.+\\.tsx?$": "ts-jest"
},
"testURL": "http://localhost/"
},
"dependencies": {
"vue": "^3.0.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^2.33.0",
"@typescript-eslint/parser": "^2.33.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-typescript": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/compiler-sfc": "^3.0.0",
"@vue/eslint-config-typescript": "^5.0.2",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^7.0.0-0",
"@types/jest": "^26.0.19",
"@typescript-eslint/eslint-plugin": "^4.10.0",
"@typescript-eslint/parser": "^4.10.0",
"@vue/cli-plugin-eslint": "~4.5.9",
"@vue/cli-plugin-typescript": "~4.5.9",
"@vue/cli-service": "~4.5.9",
"@vue/compiler-sfc": "^3.0.4",
"@vue/eslint-config-typescript": "^7.0.0",
"@vue/test-utils": "^2.0.0-beta.12",
"eslint": "^7.15.0",
"eslint-plugin-vue": "^7.2.0",
"jest": "^26.6.3",
"node-sass": "^5.0.0",
"sass-loader": "^10.1.0",
"typescript": "~3.9.3"
"ts-jest": "^26.4.4",
"typescript": "~4.1.3",
"vue-jest": "^5.0.0-alpha.7"
}
}

View File

@@ -0,0 +1,14 @@
import "jest";
import {shallowMount} from "@vue/test-utils";
import HelloWorld from "../components/HelloWorld.vue";
describe("HelloWorld.vue", () => {
test("renders props.msg when passed", () => {
const msg = "new message"
const wrapper = shallowMount(HelloWorld, {
propsData: { msg }
});
expect(wrapper.text()).toMatch(msg)
});
});

View File

@@ -12,7 +12,8 @@
"sourceMap": true,
"baseUrl": ".",
"types": [
"webpack-env"
"webpack-env",
"jest"
],
"paths": {
"@/*": [