Skip to content

Commit

Permalink
test(apis): typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
wangjinyang authored Aug 12, 2021
1 parent 9455cf5 commit f7c7cb6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/e2e/typescript.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import got from 'got';
import { AppCtx, Page, launchFixture } from '../utils';

jest.setTimeout(5 * 60 * 1000);
Expand All @@ -23,4 +24,10 @@ describe('TypesSript Suppport', () => {
/1000000000000/
);
});

test('apis should work', async () => {
let res;
res = await got.get(ctx.url('/api'));
expect(JSON.parse(res.body)).toStrictEqual({ data: 'apis index success' });
});
});
7 changes: 7 additions & 0 deletions test/fixtures/typescript/src/apis/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type resData = {
data: string;
};
export default (req, res) => {
const data: resData = { data: 'apis index success' };
return res.send(data);
};

0 comments on commit f7c7cb6

Please sign in to comment.