Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test(types): improve tests for type definitions
  • Loading branch information
dsseng committed Mar 6, 2019
commit 2a665fdda72f85f44f5e26e15e3b536da381b44d
20 changes: 16 additions & 4 deletions types/test/vue-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,13 @@ class Test extends Vue {

static testConfig() {
const { config } = this;
config.silent;
config.optionMergeStrategies;
config.devtools;
config.silent = true;
config.optionMergeStrategies = {
a: (a: number) => a + 1,
b: (a: string, b: string) => `${a} ${b}`,
c: (a: string, b: string, vm: Vue) => `${a} ${b} ${vm.$isServer}`
};
config.devtools = true;
config.errorHandler = (err, vm) => {
if (vm instanceof Test) {
vm.testProperties();
Expand Down Expand Up @@ -100,7 +104,9 @@ class Test extends Vue {
this.filter("", (value: number) => value);
this.component("", { data: () => ({}) });
this.component("", { functional: true, render(h) { return h("div", "hello!") } });
this.use;
this.use(() => {});
this.use({ install: () => {} });
this.use({ install: () => {}, foo: 'bar' });
this.mixin(Test);
this.compile("<div>{{ message }}</div>");
this
Expand Down Expand Up @@ -173,6 +179,12 @@ const GrandChild = Child.extend({
lower(): string {
return this.greeting.toLowerCase();
}
},
methods: {
bar() {
this.foo();
console.log(this.greeting);
}
}
});

Expand Down