George Kalpakas
1b8752e595
refactor(docs-infra): take advantage of latest Jasmine features in preview server tests ( #36837 )
...
This commit updates the preview server tests to take advantage of
features supported in the latest version of Jasmine that were not
supported when the rests were first written.
Changes include:
- Use [async/await] in tests.
- Use the new [toBeInstanceOf()] and [toHaveBeenCalledBefore()] matchers.
- Use the new [toBeResolved()] and [toBeRejected()] async matchers (and
their variants).
- Use the new [withArgs()] method of `Spy` to simplify "trained"
responses.
- Use the new [resolveTo()]/[rejectWith()] methods of `SpyStrategy` (and
their variants) to simplify promise-based spies.
- Implement custom async matchers (via [addAsyncMatchers()]) to simplify
certain tests.
[addAsyncMatchers()]: https://jasmine.github.io/api/3.5/jasmine.html#.addAsyncMatchers
[async/await]: https://jasmine.github.io/tutorials/async
[rejectWith()]: https://jasmine.github.io/api/3.5/SpyStrategy.html#rejectWith
[resolveTo()]: https://jasmine.github.io/api/3.5/SpyStrategy.html#resolveTo
[toBeInstanceOf()]: https://jasmine.github.io/api/3.5/matchers.html#toBeInstanceOf
[toBeRejected()]: https://jasmine.github.io/api/3.5/async-matchers.html#toBeRejected
[toBeResolved()]: https://jasmine.github.io/api/3.5/async-matchers.html#toBeResolved
[toHaveBeenCalledBefore()]: https://jasmine.github.io/api/3.5/matchers.html#toHaveBeenCalledBefore
[withArgs()]: https://jasmine.github.io/api/3.5/Spy.html#withArgs
PR Close #36837
2020-05-05 17:46:46 -07:00
George Kalpakas
eef01160f4
build(docs-infra): upgrade all JS dependencies to latest versions ( #36837 )
...
This commit upgrades all dependencies in `scripts-js/` to latest
versions and also includes all necessary code changes to ensure the
tests are passing with the new dependency versions.
PR Close #36837
2020-05-05 17:46:45 -07:00
George Kalpakas
f113b49909
test(docs-infra): remove unnecessary test helpers ( #25671 )
...
`supertest.Request` extends `Promise` and can be used directly without
"promisifying".
PR Close #25671
2018-09-26 15:26:19 -07:00
George Kalpakas
6d6b0ff1ad
feat(docs-infra): add API endpoint for checking if PR can have preview ( #25671 )
...
There several reasons why PRs cannot have (public) previews:
- The PR did not affect any relevant files (e.g. non-spec files in
`aio/` or `packages/`).
- The PR cannot be automatically verified as "trusted" (based on its
author or labels).
Note:
The endpoint does not check whether there currently is a (public)
preview for the specified PR; only whether there can be one.
PR Close #25671
2018-09-26 15:26:19 -07:00
George Kalpakas
897261efdc
test(docs-infra): fix preview server unit tests on Windows ( #25671 )
...
Some tests where comparing actual with expected paths, without taking
into account that paths will be different on Windows.
This commit uses `path.resolve()` to convert expected paths to their
OS-specific form.
PR Close #25671
2018-09-26 15:26:19 -07:00
George Kalpakas
fc0a7959a4
refactor(docs-infra): use mockable logger ( #25671 )
...
Related discussion:
https://github.com/angular/angular/pull/23576#discussion_r187925949 .
PR Close #25671
2018-09-26 15:26:19 -07:00
Pete Bacon Darwin
68bfe686d8
ci(docs-infra): rename 'upload-server' to 'preview-server'
...
The server no longer has files uploaded to it. Instead it is more
accurate to refer to it as dealing with "previews" of PRs.
2018-08-16 10:26:13 +01:00