8000 Fix main.test.ts · hoodmane/pyscript@29cc71d · GitHub
[go: up one dir, main page]

Skip to content

Commit 29cc71d

Browse files
committed
Fix main.test.ts
This resolves pyscript#1315. It is on top of pyscript#1318. There isn't all that much to do here, just a couple of minor fixes.
1 parent 87db5c8 commit 29cc71d

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

pyscriptjs/tests/unit/main.test.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
import { describe, it, expect } from '@jest/globals';
1+
import { describe, it, beforeEach, expect } from '@jest/globals';
2+
import { UserError, ErrorCode } from '../../src/exceptions';
3+
import { PyScriptApp } from '../../src/main';
24

3-
describe('Placeholder', () => {
4-
it('this is a placeholder, we need to fix and re-enable the commented out tests', () => {
5-
expect(true).toBe(true);
6-
});
7-
});
8-
9-
/*
105
describe('Test withUserErrorHandler', () => {
116
class MyApp extends PyScriptApp {
127
myRealMain: any;
@@ -17,7 +12,7 @@ describe('Test withUserErrorHandler', () => {
1712
}
1813

1914
async _realMain() {
20-
await this.myRealMain();
15+
this.myRealMain();
2116
}
2217
}
2318

@@ -68,8 +63,6 @@ describe('Test withUserErrorHandler', () => {
6863
}
6964

7065
const app = new MyApp(myRealMain);
71-
expect.assertions(1);
72-
await expect(async () => await app.main()).resolves.toThrow(new Error('Explosions!'));
66+
expect(app.main()).rejects.toThrow(new Error('Explosions!'));
7367
});
7468
});
75-
*/

0 commit comments

Comments
 (0)
0