Skip to content

Commit

Permalink
Testing: workaround TypeScript compiler limitation
Browse files Browse the repository at this point in the history
It appears that

    assert.equal(lastArgs?.type, 'dirty', 'setDirty/isDirty');

causes error

    error TS2339: Property 'type' does not exist on type 'never'.

I think this is actually a bug in tsc:

    microsoft/TypeScript#11498

So this should be considered a workaround only. Alternative solution
would be to annotate this line as @ts-ignore.
  • Loading branch information
mikkorantalainen committed Sep 5, 2024
1 parent 02f35e9 commit ef24061
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/tinymce/src/core/test/ts/browser/EditorTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ describe('browser.tinymce.core.EditorTest', () => {
assert.isFalse(editor.isDirty(), 'setDirty/isDirty');

editor.setDirty(true);
assert.equal(lastArgs?.type, 'dirty', 'setDirty/isDirty');
assert.equal((lastArgs as unknown as EditorEvent<{}>).type, 'dirty', 'setDirty/isDirty');
assert.isTrue( editor.isDirty(), 'setDirty/isDirty');

lastArgs = undefined;
Expand Down

0 comments on commit ef24061

Please sign in to comment.