Go to file
Keen Yee Liau 4985267211 test(language-service): [Ivy] return cursor position in overwritten template (#38552)
In many testing scenarios, there is a common pattern:

1. Overwrite template (inline or external)
2. Find cursor position
3. Call one of language service APIs
4. Inspect spans in result

In order to faciliate this pattern, this commit refactors
`MockHost.overwrite()` and `MockHost.overwriteInlineTemplate()` to
allow a faux cursor symbol `¦` to be injected into the template, and
the methods will automatically remove it before updating the script snapshot.
Both methods will return the cursor position and the new text without
the cursor symbol.

This makes testing very convenient. Here's a typical example:

```ts
const {position, text} = mockHost.overwrite('template.html', `{{ ti¦tle }}`);
const quickInfo = ngLS.getQuickInfoAtPosition('template.html', position);
const {start, length} = quickInfo!.textSpan;
expect(text.substring(start, start + length)).toBe('title');
```

PR Close #38552
2020-08-24 09:25:04 -07:00
.circleci fix(core): detect DI parameters in JIT mode for downleveled ES2015 classes (#38463) 2020-08-17 10:55:37 -07:00
.devcontainer build: update the recommended `Dockerfile` for VSCode remote development (#34697) 2020-01-09 13:31:14 -08:00
.github refactor(dev-infra): allow use-case and confusing types to be marked as 'triaged' (#38081) 2020-07-20 11:14:46 -07:00
.ng-dev build: update ng-dev config file for new commit message configuration (#38430) 2020-08-13 09:11:19 -07:00
.vscode build: Ignore .history for the xyz.local-history VSCode extension (#38121) 2020-07-17 13:33:39 -07:00
.yarn build: update to latest version of yarn (#36464) 2020-04-14 12:47:30 -07:00
aio docs: change function name from async -> waitForAsync (#38548) 2020-08-21 12:17:51 -07:00
dev-infra fix(dev-infra): ignore comments when validating commit messages (#38438) 2020-08-21 12:17:14 -07:00
docs docs: remove duplicate `https://` (#38199) 2020-07-23 10:54:44 -07:00
goldens Revert "fix(router): support lazy loading for empty path named outlets (#38379)" 2020-08-19 21:05:31 -07:00
integration ci: disable closure size tracking test (#38449) 2020-08-13 11:41:13 -07:00
modules refactor(dev-infra): ng_rollup_bundle rule should leverage `@bazel/rollup` (#37623) 2020-06-22 10:55:28 -07:00
packages test(language-service): [Ivy] return cursor position in overwritten template (#38552) 2020-08-24 09:25:04 -07:00
scripts style(dev-infra): enforce format on newly included files (#36940) 2020-06-12 15:06:41 -07:00
third_party build: move shims_for_IE to third_party directory (#37624) 2020-06-26 11:09:01 -07:00
tools build: run browsers tests on chromium locally (#38435) 2020-08-13 09:37:02 -07:00
.bazelignore build: add npm package manifest to npm_integration_test (#35669) 2020-02-26 12:58:35 -08:00
.bazelrc build: cleanup .bazelrc file to no longer set unused flags (#38124) 2020-08-03 12:53:11 -07:00
.bazelversion build: upgrade to bazel 3.2.0 and rules_nodejs 1.7.0 (#37358) 2020-06-08 09:15:50 -07:00
.clang-format
.editorconfig build: use https link to editorconfig.org in .editorconfig (#27664) 2018-12-18 09:30:09 -08:00
.gitattributes test: fix ts api guardian and public guard tests on windows (#30105) 2019-04-26 16:32:22 -07:00
.gitignore build: Ignore .history for the xyz.local-history VSCode extension (#38121) 2020-07-17 13:33:39 -07:00
.gitmessage build: add .gitmessage file with commit message template (#37951) 2020-07-13 09:23:03 -07:00
.mailmap build: add a Git .mailmap with my new name (#19550) 2017-10-09 14:35:30 -07:00
.nvmrc build: migrate to node@12.14.1 (#34955) 2020-01-27 09:31:22 -08:00
.pullapprove.yml fix(dev-infra): update i18n-related file locations in PullApprove config (#38403) 2020-08-10 17:29:51 -07:00
.yarnrc build: update to latest version of yarn (#36464) 2020-04-14 12:47:30 -07:00
BUILD.bazel build: move shims_for_IE to third_party directory (#37624) 2020-06-26 11:09:01 -07:00
CHANGELOG.md release: cut the v10.1.0-next.7 release 2020-08-19 09:35:47 -07:00
CODE_OF_CONDUCT.md docs: fix community tab in GitHub by copying CoC 2018-02-27 19:02:30 -08:00
CONTRIBUTING.md docs: reformat and update CONTRIBUTING.md (#37951) 2020-07-13 09:23:03 -07:00
LICENSE build: bump year (#34651) 2020-01-13 07:21:43 -08:00
README.md docs: remove browserstack badge from readme (#35684) 2020-03-17 09:29:43 -07:00
WORKSPACE build: upgrade to bazel 3.2.0 and rules_nodejs 1.7.0 (#37358) 2020-06-08 09:15:50 -07:00
browser-providers.conf.js build: run browsers tests on chromium locally (#38435) 2020-08-13 09:37:02 -07:00
gulpfile.js build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
karma-js.conf.js fix(core): detect DI parameters in JIT mode for downleveled ES2015 classes (#38463) 2020-08-17 10:55:37 -07:00
package.json release: cut the v10.1.0-next.7 release 2020-08-19 09:35:47 -07:00
test-events.js build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
test-main.js build: import in-memory-web-api project (#37182) 2020-06-15 14:28:37 -07:00
tslint.json build: Update file-header lint rule to Google LLC (#37205) 2020-05-26 14:26:58 -04:00
yarn.lock feat(dev-infra): create a wizard for building commit messages (#38457) 2020-08-18 17:01:14 -07:00
yarn.lock.readme.md build: remove travisci leftovers (#27979) 2019-01-09 10:41:16 -08:00

README.md

CircleCI Join the chat at https://gitter.im/angular/angular npm version

Angular

Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages.

Quickstart

Get started in 5 minutes.

Changelog

Learn about the latest improvements.

Want to help?

Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues in the hotlist: community-help.