Skip to content

Commit

Permalink
pass test/loader/get_appname.test.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Jun 17, 2024
1 parent b13931e commit 5e28f95
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 24 deletions.
24 changes: 0 additions & 24 deletions test/loader/get_appname.test.js

This file was deleted.

22 changes: 22 additions & 0 deletions test/loader/get_appname.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { strict as assert } from 'node:assert';
import { Application, createApp, getFilepath } from '../helper.js';

describe('test/loader/get_appname.test.ts', () => {
let app: Application;
afterEach(() => app && app.close());

it('should get appname', () => {
app = createApp('appname');
assert.equal(app.loader.getAppname(), 'appname');
});

it('should throw when appname is not found', done => {
const pkg = getFilepath('app-noname/package.json');
try {
createApp('app-noname');
} catch (err: any) {
assert(err.message.includes(`name is required from ${pkg}`));
done();
}
});
});

0 comments on commit 5e28f95

Please sign in to comment.