Skip to content

Commit 36c3b79

Browse files
committed
Fix tests
1 parent 8db36a4 commit 36c3b79

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/index.test.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ const classes = {
2020
'makeCurrent','destroy','iconify','restore','hide','show',
2121
],
2222
destroy(instance) {
23-
instance.destroy();
23+
if (instance) {
24+
instance.destroy();
25+
}
2426
},
2527
},
2628

@@ -38,7 +40,9 @@ const classes = {
3840
'addEventListener','removeEventListener','requestAnimationFrame',
3941
],
4042
destroy(instance) {
41-
instance.destroy();
43+
if (instance) {
44+
instance.destroy();
45+
}
4246
},
4347
},
4448

@@ -69,14 +73,13 @@ describe('GLFW', () => {
6973
});
7074

7175
afterAll(() => {
72-
current.destroy();
76+
current.destroy(instance);
7377
});
7478

7579
it('can be created', () => {
7680
expect(instance).toBeInstanceOf(glfw[c]);
7781
});
7882

79-
8083
current.props.forEach(prop => {
8184
it(`#${prop} property exposed`, () => {
8285
expect(instance).toHaveProperty(prop);

0 commit comments

Comments
 (0)