Skip to content

Commit

Permalink
tests(jest): moving away from ava - migrate to jest
Browse files Browse the repository at this point in the history
  • Loading branch information
breakingrobot committed Apr 12, 2018
1 parent 6d37d61 commit 0a3621f
Show file tree
Hide file tree
Showing 10 changed files with 3,015 additions and 4,896 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ node_modules
npm-debug.log
src/*.js
test/*.js
.rpt2_cache/*
yarn-error.log
23 changes: 23 additions & 0 deletions fixtures/emit.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import Vue, { VNode } from 'vue';
import { Component, Emit, Inject, Model, Prop, Provide, Watch } from '../src/nuxt-property-decorator';

@Component
export default class EmitFixture extends Vue {
count = 0;

@Emit('reset') resetCount() {
this.count = 0;
}

@Emit() increment(n: number) {
this.count += n;
}

@Emit() canceled() {
return false;
}

render (createElement: any): VNode {
return createElement('div');
}
}
35 changes: 35 additions & 0 deletions fixtures/inject.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import Vue, { VNode } from 'vue';
import { Component, Emit, Inject, Model, Prop, Provide, Watch } from '../src/nuxt-property-decorator';

const s = Symbol()
@Component({
provide() {
return {
[s]: 'one',
bar: 'two'
}
}
})
export class Parent extends Vue {
render (createElement: any): VNode {
return createElement('div');
}
}

@Component
export class Child extends Vue {
@Inject(s) foo: string
@Inject() bar: string
render (createElement: any): VNode {
return createElement('div');
}
}

@Component
export class GrandChild extends Vue {
@Inject(s) foo: string
@Inject() bar: string
render (createElement: any): VNode {
return createElement('div');
}
}
13 changes: 13 additions & 0 deletions fixtures/model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Vue, { VNode } from 'vue';
import { Component, Model } from '../src/nuxt-property-decorator';

@Component({
name: 'test'
})
export default class ModelFixture extends Vue {
@Model('change')
checked: boolean;
render (createElement: any): VNode {
return createElement('div');
}
}
Loading

0 comments on commit 0a3621f

Please sign in to comment.