Commit b71fc081 authored by nanahira's avatar nanahira

a bit fix in unit test

parent e155e900
Pipeline #15620 passed with stages
in 1 minute and 37 seconds
......@@ -33,7 +33,7 @@
"typescript": "^4.7.4"
},
"peerDependencies": {
"cordis": "^2.0.6",
"cordis": "^2.1.0",
"schemastery": "^3.5.1"
}
},
......@@ -1853,9 +1853,9 @@
}
},
"node_modules/cordis": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/cordis/-/cordis-2.0.6.tgz",
"integrity": "sha512-Q85Y2iY3myX340TiUV97DtTuPTls/pZoYqP2eWHlkLYcIzs7cIBTX3C8FqxaZ2hRgOJ6kMcXSXSIPWsZGcyCHQ==",
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/cordis/-/cordis-2.1.0.tgz",
"integrity": "sha512-GPdkYAEIRzBQlTW4eHoKgD+efXCiubujIC2MoqXpEwwaW1Y2ifxWoPNT+JSYrSH3fbtA70QV05rIP+L0lkB9CQ==",
"peer": true,
"dependencies": {
"cosmokit": "^1.2.1"
......@@ -6204,9 +6204,9 @@
}
},
"cordis": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/cordis/-/cordis-2.0.6.tgz",
"integrity": "sha512-Q85Y2iY3myX340TiUV97DtTuPTls/pZoYqP2eWHlkLYcIzs7cIBTX3C8FqxaZ2hRgOJ6kMcXSXSIPWsZGcyCHQ==",
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/cordis/-/cordis-2.1.0.tgz",
"integrity": "sha512-GPdkYAEIRzBQlTW4eHoKgD+efXCiubujIC2MoqXpEwwaW1Y2ifxWoPNT+JSYrSH3fbtA70QV05rIP+L0lkB9CQ==",
"peer": true,
"requires": {
"cosmokit": "^1.2.1"
......
......@@ -55,7 +55,7 @@
"typescript": "^4.7.4"
},
"peerDependencies": {
"cordis": "^2.0.6",
"cordis": "^2.1.0",
"schemastery": "^3.5.1"
},
"dependencies": {
......
import { DefinePlugin, StarterPlugin, UseEvent } from './utility/decorators';
import { Provide, UsingService } from '../src/decorators';
import { Provide, Reusable, UsingService } from '../src/decorators';
import { Context } from 'cordis';
declare module 'cordis' {
......@@ -12,6 +12,7 @@ declare module 'cordis' {
@DefinePlugin()
class MyProvider extends StarterPlugin() {}
@Reusable()
@DefinePlugin()
class MyPlugin extends StarterPlugin() {
@UsingService('foo')
......@@ -29,7 +30,7 @@ describe('Partial using service', () => {
expect(app.bail('foo')).toBeUndefined();
const state = app.plugin(MyProvider);
expect(app.bail('foo')).toBe('bar');
state.dispose();
app.registry.delete(MyProvider);
expect(app.bail('foo')).toBeUndefined();
app.plugin(MyProvider);
expect(app.bail('foo')).toBe('bar');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment