Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
popomore committed Sep 19, 2023
1 parent 21c7fd2 commit cb4d424
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions standalone/standalone/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,39 @@ describe('test/index.test.ts', () => {
`withCrossAroundResult(withPointAroundResult(hello withPointAroundParam(withCrosscutAroundParam(aop))${JSON.stringify(pointcutAdviceParams)})${JSON.stringify(crosscutAdviceParams)})`);
});
});

describe('load', () => {
let runner: Runner;
afterEach(async () => {
if (runner) await runner.destroy();
});

it('should work', async () => {
runner = new Runner(path.join(__dirname, './fixtures/simple'));
const loadunits = await runner.load();
for (const loadunit of loadunits) {
for (const proto of loadunit.iterateEggPrototype()) {
if (proto.id.match(/:hello$/)) {
assert.strictEqual(proto.className, 'Hello');
} else if (proto.id.match(/:moduleConfigs$/)) {
assert.strictEqual(proto.className, undefined);
} else if (proto.id.match(/:moduleConfig$/)) {
assert.strictEqual(proto.className, undefined);
}
}
}
});

it('should work with multi', async () => {
runner = new Runner(path.join(__dirname, './fixtures/multi-callback-instance-module'));
const loadunits = await runner.load();
for (const loadunit of loadunits) {
for (const proto of loadunit.iterateEggPrototype()) {
if (proto.id.match(/:dynamicLogger$/)) {
assert.strictEqual(proto.className, 'DynamicLogger');
}
}
}
});
});
});

0 comments on commit cb4d424

Please sign in to comment.