build: upgrade jasmine (and related typings) to latest version (#19904)
With these changes, the types are a little stricter now and also not compatible with Protractor's jasmine-like syntax. So, we have to also use `@types/jasminewd2` for e2e tests (but not for non-e2e tests). I also had to "augment" `@types/jasminewd2`, because the latest typings from [DefinitelyTyped][1] do not reflect the fact that the `jasminewd2` version (v2.1.0) currently used by Protractor supports passing a `done` callback to a spec. [1]: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/566e0394859fdc1dc893658ccec6b06372d56a91/types/jasminewd2/index.d.ts#L9-L15 Fixes #23952 Closes #24733 PR Close #19904
This commit is contained in:
committed by
Miško Hevery
parent
1e74ea9e60
commit
00c110b055
@@ -274,7 +274,7 @@ import {CssLexer, CssLexerMode, CssToken, CssTokenType, cssScannerError, getRawM
|
||||
it('should throw an error if a selector is being parsed while in the wrong mode', () => {
|
||||
const cssCode = '.class > tag';
|
||||
|
||||
let capturedMessage: string = undefined !;
|
||||
let capturedMessage: string|null = null;
|
||||
try {
|
||||
tokenize(cssCode, false, CssLexerMode.STYLE_BLOCK);
|
||||
} catch (e) {
|
||||
@@ -282,8 +282,8 @@ import {CssLexer, CssLexerMode, CssToken, CssTokenType, cssScannerError, getRawM
|
||||
}
|
||||
|
||||
expect(capturedMessage).toMatch(/Unexpected character \[\>\] at column 0:7 in expression/g);
|
||||
capturedMessage = null !;
|
||||
|
||||
capturedMessage = null;
|
||||
try {
|
||||
tokenize(cssCode, false, CssLexerMode.SELECTOR);
|
||||
} catch (e) {
|
||||
|
||||
@@ -170,21 +170,22 @@ function _getCaptureAst(capture: any[], index = 0): CssAst {
|
||||
expect(captures.length).toEqual(3);
|
||||
|
||||
const rule1 = <CssSelectorRuleAst>_getCaptureAst(captures, 0);
|
||||
expect(rule1).toEqual(ast.rules[0]);
|
||||
expect(rule1).toEqual(ast.rules[0] as CssSelectorRuleAst);
|
||||
|
||||
const firstSelector = rule1.selectors[0];
|
||||
const firstSimpleSelector = firstSelector.selectorParts[0];
|
||||
_assertTokens(firstSimpleSelector.tokens, ['.', 'rule1']);
|
||||
|
||||
const rule2 = <CssSelectorRuleAst>_getCaptureAst(captures, 1);
|
||||
expect(rule2).toEqual(ast.rules[1]);
|
||||
expect(rule2).toEqual(ast.rules[1] as CssSelectorRuleAst);
|
||||
|
||||
const secondSelector = rule2.selectors[0];
|
||||
const secondSimpleSelector = secondSelector.selectorParts[0];
|
||||
_assertTokens(secondSimpleSelector.tokens, ['.', 'rule2']);
|
||||
|
||||
const rule3 = <CssSelectorRuleAst>_getCaptureAst(captures, 2);
|
||||
expect(rule3).toEqual((<CssMediaQueryRuleAst>ast.rules[2]).block.entries[0]);
|
||||
expect(rule3).toEqual(
|
||||
(ast.rules[2] as CssSelectorRuleAst).block.entries[0] as CssSelectorRuleAst);
|
||||
|
||||
const thirdSelector = rule3.selectors[0];
|
||||
const thirdSimpleSelector = thirdSelector.selectorParts[0];
|
||||
|
||||
Reference in New Issue
Block a user