Commit a64ea7b0 authored by nanahira's avatar nanahira

nothing large changes

parent c4724ab2
This diff is collapsed.
......@@ -62,6 +62,6 @@
"lodash": "^4.17.21"
},
"peerDependencies": {
"koishi": "^4.9.7"
"koishi": "^4.11.0"
}
}
import { Context } from 'koishi';
import { App, Context } from 'koishi';
import { Registrar } from 'cordis-decorators';
import WebSocket from 'ws';
......@@ -89,4 +89,4 @@ export class SatoriRegistrar<Ctx extends Context> extends Registrar<Ctx> {
}
}
export const defaultRegistrarS = new SatoriRegistrar(Context);
export const defaultRegistrarS = new SatoriRegistrar(App);
import { Context } from 'koishi';
import { App } from 'koishi';
import { MapPlugin, MergePlugin } from '../src/plugin-operators';
import { SchemaProperty } from 'cordis-decorators';
import { DefinePlugin, StarterPlugin, UseEvent } from './utility/decorators';
......@@ -66,7 +66,7 @@ class MergedWearingPlugin extends MergePlugin(
describe('register map plugin instance', () => {
it('should work on each level', async () => {
const app = new Context();
const app = new App();
app.plugin(WearingPlugin, {
dress: { color: 'red' },
skirt: { size: 'XL' },
......@@ -78,7 +78,7 @@ describe('register map plugin instance', () => {
expect(app.bail('wearingStrip')).toBe('pink');
});
it('should partial register', async () => {
const app = new Context();
const app = new App();
app.plugin(WearingPlugin, {
dress: { color: 'red' },
strip: 'pink',
......@@ -89,7 +89,7 @@ describe('register map plugin instance', () => {
expect(app.bail('skirtSize')).toBe('S');
});
it('should work on merge plugin', async () => {
const app = new Context();
const app = new App();
app.plugin(MergedWearingPlugin, {
color: 'red',
size: 'XL',
......
import { RegisterSchema, SchemaProperty } from 'cordis-decorators';
import { DefinePlugin, StarterPlugin, UseEvent } from './utility/decorators';
import { MultiInstancePlugin } from '../src/plugin-operators';
import { Context, Schema } from 'koishi';
import { App, Schema } from 'koishi';
declare module 'cordis' {
interface Events<C> {
......@@ -70,7 +70,7 @@ class Outer2 extends MultiInstancePlugin(Inner2, OuterMessageConfig) {
describe('register multi plugin instance', () => {
it('should work on schemastery-gen', async () => {
const app = new Context();
const app = new App();
app.plugin(Outer, { msg: 'hello', instances: [{ msg: 'world' }] });
await app.start();
expect(app.bail('message1')).toBe('world');
......@@ -79,7 +79,7 @@ describe('register multi plugin instance', () => {
});
it('should work on common schemastery', async () => {
const app = new Context();
const app = new App();
app.plugin(Outer2, { msg: 'hello', instances: [{ msg: 'world' }] });
await app.start();
expect(app.bail('message1')).toBe('world');
......
import { OnGuild, OnPlatform } from '../src/decorators';
import { Context, Session } from 'koishi';
import { App, Session } from 'koishi';
import { defaultRegistrarS } from '../src/registrar';
@OnPlatform('discord')
......@@ -9,10 +9,10 @@ class MyClass {
}
describe('Scope', () => {
let app: Context;
let app: App;
beforeEach(async () => {
app = new Context();
app = new App();
await app.start();
});
......
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