I am writing tests using jasmine-ts, and I have a number of working tests that do not use types representing dom elements.
Now I have written a test that can be simplified to the following:
describe("A Test",
() => {
it("when an element is created then it is defined",
() => {
const element = new SVGGElement();
expect(element).toBeDefined();
}
);
}
);
When running the test using jasmine-ts, the test fails with the following error:
Message: ReferenceError: SVGGElement is not defined Stack: ReferenceError: SVGGElement is not defined at Object. (C:\Path\Test.spec.ts:50:37)
I see that SVGGElement is declared in both
- ...\TypeScript\2.4\lib.es6.d.ts, and
- ...\TypeScript\2.4\lib.dom.d.ts
All compiles when using tsc, though there is no explicit import for this type. Presumably this works because of the following in tsconfig.json:
"compilerOptions": {
"lib": [ "es6", "dom" ]
}
How do I configure things so that it is possible to run this test?