Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
Add marble unit test #3, fix testing environment
Browse files Browse the repository at this point in the history
  • Loading branch information
mort3za committed Jul 12, 2019
1 parent 9e17120 commit 49e8a0e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 19 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"babel-core": "7.0.0-bridge.0",
"sass": "1.22.4",
"sass-loader": "7.1.0",
"ts-jest": "24.0.2",
"ts-jest": "23",
"tslint-config-prettier": "1.18.0",
"typescript": "3.5.3",
"vue-template-compiler": "2.6.10"
Expand Down
4 changes: 2 additions & 2 deletions src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const vuexLocal = new VuexPersistence({
const store = new Vuex.Store({
plugins: [vuexLocal.plugin],
state: {
appVersion: JSON.parse(unescape(process.env.APP_VERSION)),
buildDate: JSON.parse(unescape(process.env.BUILD_DATE)),
appVersion: JSON.parse(unescape(process.env.APP_VERSION || 0)),
buildDate: JSON.parse(unescape(process.env.BUILD_DATE || 0)),
gameStatus: GameStatus.NOT_STARTED,
lastSavedAt: null
},
Expand Down
12 changes: 0 additions & 12 deletions tests/unit/example.spec.ts

This file was deleted.

16 changes: 16 additions & 0 deletions tests/unit/marble.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// tslint:disable-next-line: no-implicit-dependencies
import { shallowMount } from "@vue/test-utils";
import MarbleComponent from "@/components/Marble.vue";
import { listInitial } from "@/store/initials/marbles-initial.ts";

describe("Marble.vue", () => {
it("renders props.model when passed", () => {
const model = listInitial[0];
const sideClassName = `is-side-${model.side}`
const wrapper = shallowMount(MarbleComponent, {
propsData: { model }
});
console.log(wrapper, wrapper.classes());
expect(wrapper.classes()).toContain(sideClassName);
});
});
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8883,10 +8883,10 @@ tryer@^1.0.0:
resolved "https://registry.yarnpkg.com/tryer/-/tryer-1.0.1.tgz#f2c85406800b9b0f74c9f7465b81eaad241252f8"
integrity sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==

ts-jest@24.0.2:
version "24.0.2"
resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-24.0.2.tgz#8dde6cece97c31c03e80e474c749753ffd27194d"
integrity sha512-h6ZCZiA1EQgjczxq+uGLXQlNgeg02WWJBbeT8j6nyIBRQdglqbvzDoHahTEIiS6Eor6x8mK6PfZ7brQ9Q6tzHw==
ts-jest@23:
version "23.10.5"
resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-23.10.5.tgz#cdb550df4466a30489bf70ba867615799f388dd5"
integrity sha512-MRCs9qnGoyKgFc8adDEntAOP64fWK1vZKnOYU1o2HxaqjdJvGqmkLCPCnVq1/If4zkUmEjKPnCiUisTrlX2p2A==
dependencies:
bs-logger "0.x"
buffer-from "1.x"
Expand Down

0 comments on commit 49e8a0e

Please sign in to comment.