Skip to content

Commit

Permalink
test(types-plugin): reproduce Automattic#12454
Browse files Browse the repository at this point in the history
  • Loading branch information
hasezoey committed Sep 22, 2022
1 parent 4495cf3 commit e447ff1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/types/plugin.test.ts
Expand Up @@ -38,6 +38,12 @@ function pluginStatics(schema: Schema<Test, TestModel, any, TestQueryHelpers, an
});
}

function pluginGeneric(schema: Schema): void {
schema.static('test', function() {
return 0;
});
}

type Test = { firstName: string; lastName: string };
type TestVirtuals = {
fullName: string;
Expand All @@ -63,6 +69,7 @@ testSchema.plugin(pluginVirtuals);
testSchema.plugin(pluginQueryHelpers);
testSchema.plugin(pluginMethods);
testSchema.plugin(pluginStatics);
testSchema.plugin(pluginGeneric);

const Foo = connection.model<Test, TestModel, TestQueryHelpers>('Test', testSchema);

Expand Down

0 comments on commit e447ff1

Please sign in to comment.