test(docs-infra): run tests in random order (and make them pass) (#31527)
This commit updates the necessary config files to run the angular.io and docs tooling unit tests in random order (and fixes the tests that were failing due to their dependence on the previous ordered execution). Besides being a good idea anyway, running tests in random order is the new [default behavior in jasmine@3.0.0][1], so this commit is in preparation of upgrading jasmine to the latest version. [1]: https://github.com/jasmine/jasmine/blob/v3.0.0/release_notes/3.0.md#breaking-changes PR Close #31527
This commit is contained in:

committed by
Miško Hevery

parent
e8ae3c5f2e
commit
d7ca263cc4
13
aio/src/testing/pretty-printer.service.ts
Normal file
13
aio/src/testing/pretty-printer.service.ts
Normal file
@ -0,0 +1,13 @@
|
||||
// The actual `PrettyPrinter` service has to load `prettify.js`, which (a) is slow and (b) pollutes
|
||||
// the global `window` object (which in turn may affect other tests).
|
||||
// This is a mock implementation that does not load `prettify.js` and does not pollute the global
|
||||
// scope.
|
||||
|
||||
import { of } from 'rxjs';
|
||||
|
||||
export class MockPrettyPrinter {
|
||||
formatCode(code: string, language?: string, linenums?: number | boolean) {
|
||||
const linenumsStr = (linenums === undefined) ? '' : `, linenums: ${linenums}`;
|
||||
return of(`Formatted code (language: ${language || 'auto'}${linenumsStr}): ${code}`);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user