angular-docs-cn/integration/language_service_plugin
Keen Yee Liau f8ad4d1e99 test(language-service): Improve integration test (#28168)
The current integration test for language service involves piping the
results of one process to another using Unix pipes.
This makes the test hard to debug, and hard to configure.

This commit refactors the integration test to use regular Jasmine
scaffolding.

More importantly, it tests the way the language service will actually
be installed by end users. Users would not have to add
`@angular/language-service` to the plugins section in tsconfig.json
Instead, all they need to do is install the *extension* from
the VS Code Marketplace and Angular Language Service will be loaded
as a global plugin.

PR Close #28168
2019-01-17 14:11:28 -08:00
..
goldens test(language-service): Improve integration test (#28168) 2019-01-17 14:11:28 -08:00
project test(language-service): Improve integration test (#28168) 2019-01-17 14:11:28 -08:00
.gitignore test(language-service): Improve integration test (#28168) 2019-01-17 14:11:28 -08:00
README.md test(language-service): test `@angular/language-service` can be loaded by tsserver.js (#14721) 2017-03-01 13:22:46 -08:00
generate.ts test(language-service): Improve integration test (#28168) 2019-01-17 14:11:28 -08:00
matcher.ts test(language-service): Improve integration test (#28168) 2019-01-17 14:11:28 -08:00
package.json test(language-service): Improve integration test (#28168) 2019-01-17 14:11:28 -08:00
test.ts test(language-service): Improve integration test (#28168) 2019-01-17 14:11:28 -08:00
tsclient.ts test(language-service): Improve integration test (#28168) 2019-01-17 14:11:28 -08:00
tsconfig.json test(language-service): Improve integration test (#28168) 2019-01-17 14:11:28 -08:00
yarn.lock test(language-service): Improve integration test (#28168) 2019-01-17 14:11:28 -08:00

README.md

Angular Language Service Test

This directory is an integration test for @angular/language-service to ensure that various versions of the server can be loaded in the supported versions of TypeScript's language service.

New supported version of TypeScript

To add a new supported version of TypeScript:

  1. Create directory in typescripts to hold the new version following the pattern of the other versions.
  2. Add the directory name to the end of the TYPESCRIPTS variable in the scripts/env.sh file.
  3. Run scripts/update_golden.sh to generate the expected files.
  4. Verify the expected output is reasonable by comparing to a known good output from a previous version.

Update golden files

If the expected output needs to be updated run scripts/update_golden.sh to update the expected output of the server.

Adding a new fixture

Currently there is no automated way to produce a new fixture. The way the current fixtures were created was to hack a version of tsserver.js to write the commands from VSCode to a file while performing the operation to be tested. I also hand modified the input to remove superfluous request.

Once a new fixture is created:

  1. Add the fixture base name (without the .json) to FIXTURES in scripts/env.sh.
  2. Run scripts/udpate_golden.sh to produce the expected output files.
  3. Hand validate the expected output is reasonable.