Commit Graph

51 Commits

Author SHA1 Message Date
George Kalpakas 8660806ddc build(docs-infra): renamed `e2e` property of `example-config.json` to `tests` (#36143)
Each docs example has an `example-config.json` configuration file. Among
other things, this file can be used to specify what commands to run in
order to test the example. (If not specified, the `run-example-e2e.js`
script will run a default `yarn e2e` command.)

Previously, the property specifying the test commands was called `e2e`.
This is because in the past only e2e tests were run for docs examples.
Since recently, some examples may specify commands for other types of
tests (such as unit tests). Therefore, calling the property that holds
the list of test commands `e2e` no longer makes sense and can be
misleading to people looking at the configuration files.

This commit renamed the property to the more generic `tests`. In the
future, the `run-example-e2e.js` script (and corresponding npm script)
should be renamed and refactored to also avoid giving the impression
that only e2e tests are run.

Discussed in:
https://github.com/angular/angular/pull/36143#discussion_r395148379

PR Close #36143
2020-04-06 15:31:07 -07:00
George Kalpakas d707124fd9 test(docs-infra): fix unit tests and run them for specific docs examples on CI (#36143)
Previously, only e2e tests were run for docs examples on CI. As a
result, unit tests (which are included in the zipped archives we provide
for users to download and play with the examples locally) were often
outdated and broken.

This commit configures specific docs examples that have meaningful unit
tests to run them on CI (via the `run-example-e2e.js` script). Where
necessary, the unit tests are fixed to ensure they pass and reflect the
changes in the corresponding component/service.
This commit also removes some auto-generated unit tests that are not
meaningful (e.g. make trivial assertions, such that a component instance
is truthy) and are often broken anyway (e.g. because the corresponding
component has been changed in ways that make the tests fail).

PR Close #36143
2020-04-06 15:31:07 -07:00
George Kalpakas fc325c49ec build(docs-infra): update project structure to cli@9 3/12 (`title in a h1 tag`) (#36015)
Make test description less implementation specific.

PR Close #36015
2020-03-18 10:00:01 -07:00
George Kalpakas a8e936791b build(docs-infra): update project structure to cli@9 2/12 (`fixture.debugElement.componentInstance`) (#36015)
`fixture.debugElement.componentInstance` --> `fixture.componentInstance`

PR Close #36015
2020-03-18 10:00:01 -07:00
George Kalpakas fbed0a1471 build(docs-infra): remove unused `test.html` file from `testing` example (#36015)
This file was from back when the `testing` example was not based on the
Angular CLI and is not used any more.

PR Close #36015
2020-03-18 10:00:01 -07:00
George Kalpakas 8eb4a9d395 docs: fix docs and associated code snippets for enabling more macro tasks in `fakeAsync()` (#35778)
In the `testing` guide, there is a section discussing configuring
`fakeAsync()` to handle more macro tasks (e.g.
`HTMLCanvasElement#toBlob()`).

Previously, the corresponding code snippets (some of which were
hard-coded in the guide) were incorrect/incomplete and the associated
tests were broken. This was discovered while enabling docs examples unit
tests in #34374.

This commit fixes the code snippets and associated tests and ensures the
examples used in the guide come from an example app (i.e. are not
hard-coded).

Note: The docs examples unit tests are currently not run on CI. This
will be fixed in #34374.

PR Close #35778
2020-03-02 13:30:25 -08:00
JiaLiPassion 17b862cf82 feat: add an tickOptions parameter with property processNewMacroTasksSynchronously. (#33838)
This option will control whether to invoke the new macro tasks when ticking.

Close #33799

PR Close #33838
2020-02-20 15:14:59 -08:00
Oleg Teterin 79742a397f fix(docs-infra): fix parameters with @Optional() decorator do not match declared, optional type (#35150)
PR Close #35150
2020-02-07 09:58:31 -08:00
Alan Agius 8f389361ec docs: replace lazy loading import syntax parameter name (#34599)
We replace `mod` with `m` to be in line with what the CLI generates.

PR Close #34599
2020-01-07 10:44:12 -08:00
ajitsinghkaler 1217c6b7cc docs: replace class hero to interface wherever class properties not used (#34022)
Fixes #21186

PR Close #34022
2019-11-25 11:37:39 -05:00
crisbeto 9d54679e66 test: clean up explicit dynamic query usages (#33015)
Cleans up all the places where we explicitly set `static: false` on queries.

PR Close #33015
2019-10-17 16:10:10 -04:00
Adam J. Penn c8fd94ea44 style(router): removed extra semicolon (#33062)
PR Close #33062
2019-10-10 15:26:20 -07:00
Danny Skoog 6ab5f3648a refactor: utilize type narrowing (#33075)
PR Close #33075
2019-10-10 15:18:44 -07:00
Jakub Pawlot e7729b6863 docs: add comment about newEvent utility function (#32001)
PR Close #32001
2019-10-02 13:28:38 -07:00
Carlos Ortiz García 9166baf709 refactor(core): Migrate TestBed.get to TestBed.inject (#32382)
This is cleanup/followup for PR #32200

PR Close #32382
2019-09-09 19:10:54 -04:00
George Kalpakas 2e84f4e0cd build(docs-infra): fix StackBlitz projects and ZIPs for `testing` guide examples (#31937)
- Update the `stackblitz.json` config files (used for generating
  Stackblitz projects and ZIP archives) to include the correct files
  (taking into account the current layout of the example projects).
- Update the boilerplate files for `testing` examples to match the
  current layout of the example projects.

PR Close #31937
2019-08-05 09:54:52 -07:00
Kapunahele Wong 02d98ed823 docs: fix testing example (#31120)
PR Close #31120
2019-06-25 10:28:50 -07:00
Alex Rickabaugh 84dd2679a9 fix(core): require 'static' flag on queries in typings (#30639)
This commit makes the static flag on @ViewChild and @ContentChild required.

BREAKING CHANGE:

In Angular version 8, it's required that all @ViewChild and @ContentChild
queries have a 'static' flag specifying whether the query is 'static' or
'dynamic'. The compiler previously sorted queries automatically, but in
8.0 developers are required to explicitly specify which behavior is wanted.
This is a temporary requirement as part of a migration; see
https://angular.io/guide/static-query-migration for more details.

@ViewChildren and @ContentChildren queries are always dynamic, and so are
unaffected.

PR Close #30639
2019-05-24 16:55:00 -04:00
Brandon e1af6e3c70 docs: use dynamic import syntax in examples using lazy loading (#30563)
PR Close #30563
2019-05-21 09:09:35 -07:00
janith c79bffaacb docs: remove gender prefixes from examples (#29972)
PR Close #29972
2019-05-20 16:42:59 -07:00
Jimmy Kasprzak 3a8f74e392 docs: fix example "testing" app compilation (#30427)
PR Close #30427
2019-05-15 14:12:22 -07:00
Brandon 1c251e59d7 docs: fix failing specs in testing example (#29256)
The tests that need the actuallyDone flag are grouped together

PR Close #29256
2019-03-12 11:58:28 -07:00
Adam Plumer a29ce57732 docs: migrate examples from @angular/http to @angular/common/http (#28296)
PR Close #28296
2019-03-11 10:52:17 -07:00
krzysztof-grzybek cfb41452ce docs: update testing doc example style for HostListener (#26372)
HostListener is preferred over host metadata by official style guide

PR Close #26372
2019-01-14 17:04:46 -08:00
seunggabi 36e7bf1b7b style: change style css syntax (#27253)
PR Close #27253
2018-11-29 21:26:53 -08:00
Brandon Roberts 67ad9468d3 docs: fix broken lazy loading examples with Angular CLI RC upgrade (#25892)
PR Close #25892
2018-10-09 17:04:19 -07:00
Brandon Roberts 67435d456c Revert "docs: add testing styles in index.html, remove additional configuration" (#25892)
This reverts commit 621d82a44c9d46f69f3296b302984f5949b8dee8.

PR Close #25892
2018-10-09 17:04:19 -07:00
Brandon Roberts fbfce79b93 docs: add testing styles in index.html, remove additional configuration (#25892)
PR Close #25892
2018-10-09 17:04:19 -07:00
JiaLi.Passion ccceff5ecc docs: add fakeAsync test new feature document (#23117)
PR Close #23117
2018-10-05 15:43:37 -07:00
JiaLi.Passion ebf508fcd0 docs: add docs for fakeAsync test with custom macroTask in aio (#21669)
PR Close #21669
2018-08-08 13:11:15 -07:00
Brandon Roberts db2329ef6a docs(aio): Add missing dependencies and files to testing zip file download (#23948)
Closes #23060

PR Close #23948
2018-05-21 16:12:40 -04:00
Rafael 639d52fe71 refactor: ensure all 'TODO's are consistent (#23252)
PR Close #23252
2018-04-13 13:11:01 -07:00
Jeremy Attali 993eeababb docs: fix typo in injected variable name (#23315)
The service injected is `ValueService`, however the name of the variable
does not reflect that. It's actually confusing since it's the name of
the `class` being created.

PR Close #23315
2018-04-12 23:16:52 -07:00
JiaLi.Passion c560423b52 build: upgrade zone.js (#23108)
PR Close #23108
2018-04-04 08:24:02 -07:00
Victor Berchet 4bd3a65764 fix(aio): mark the 'titlecase' pipe as pure (#22959)
PR Close #22959
2018-03-23 16:28:05 -04:00
Igor Minar b43f8bc7d3 feat(core): upgrade rxjs to 6.0.0-alpha.4 (#22573)
PR Close #22573
2018-03-19 21:51:51 -07:00
Ward Bell 1f9734315d docs: testing - highlight dispatchEvent (#22726)
PR Close #22726
2018-03-14 10:21:41 -07:00
Ward Bell a7e1f236ff docs: testing guide for CLI (#20697)
- updates tests
- heavy prose revisions
- uses HttpClient (with angular-in-memory-web-api)
- test HeroService using `HttpClientTestingModule`
- scrub away most By.CSS
- fake async observable with `asyncData()`
- extensive Twain work
- different take on retryWhen
- remove app barrels (& systemjs.extras) which troubled plunker/systemjs
- add dummy export const to hero.ts (plunkr/systemjs fails w/o it)
- shrink and re-organize TOC
- add marble testing package and tests
- demonstrate the "no beforeEach()" test coding style
- add section on Http service testing
- prepare for stackblitz
- confirm works in plunker except excluded marble test
- add tests for avoidFile class feature of CodeExampleComponent

PR Close #20697
2018-02-26 13:40:23 -08:00
Jesus Rodriguez 1a75934cc0 build(aio): migrate plunker to stackblitz (#20165)
PR Close #20165
2018-01-23 21:30:27 -08:00
Zenn dcc3eba962 fix(aio): fix test message's mistake. (#21254)
duplicated message for 1st link. /heroes is 2nd link.

PR Close #21254
2018-01-04 17:38:25 -05:00
Jesus Rodriguez 9bbf009dff build(aio): change examples to CLI (#19248)
PR Close #19248
2017-09-21 17:05:54 -07:00
Ward Bell 112e777b90 build(aio): update karma & systemjs config for HttpClient
While adding the references to the `HttpClient` packages it also crucially
adds ref to new “tslib” library required by `HttpClient`.
2017-09-08 19:31:15 -04:00
Victor Berchet c723d42d0a refactor: fix typos (#18000) 2017-07-07 16:55:17 -07:00
Brandon Roberts 8d01db4638 docs: Updated router guide content and examples for paramMap
and queryParamMap, tracing, and incidental improvements.
closes #16991 and #16259 which it also fixes.
2017-06-29 09:35:39 -07:00
Peter Bacon Darwin a0b30e5dfb docs(aio): remove example specific `.gitignore` files
All the files that should be ignored are defined in the
`aio/content/examples/.gitigore` folder.
2017-06-09 14:33:21 +01:00
Jesús Rodríguez 55b8de9fdd build(aio): lint examples 2017-05-03 13:44:41 -07:00
Ward Bell 93516ea8a1 docs(aio): rename cb- files and a few others 2017-04-24 14:00:51 +01:00
Jesus Rodriguez 061475402c docs(aio): final migration from old site 2017-04-12 21:01:55 +01:00
Peter Bacon Darwin fd72fad8fd docs(aio): update migrated content from anguar.io 2017-03-28 10:21:46 +01:00
Jason Aden b74ab83d2c refactor: update paths from modules/@angular to packages 2017-03-08 16:29:28 -08:00