-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Angular Signals CT Harness for Angular 17.2 and up for user…
…s to be able to use Angular Signals within their component tests (#29621) * direct copy paste of angular npm package to angular18 (no changes) * feat: implement angular-signals test hardness to support angular signals add changelog entry and build binary [run ci] rename angular18 to angular-signals until we are able to merge back into core package [run ci] fix linting job [run ci] make sure angular-signals harness is copied to cli after build [run ci] add project fixture directory to angular 18 and build binaries for newly named branch run ci update cache [run ci] bust nx cache [run ci] bust cache on linux [run ci] try busting the cache... again [run ci] usually helps when you have the correct build output... [run ci] fix issue where component internal props were getting blown away when user would not set prop in componentProperties [run ci] * update test harness description * add built-in control flow tests with signals * make sure to clean up rxjs observables in order to prevent a memory leak * address comments from code review * yarn lock --------- Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
- Loading branch information
1 parent
ed85a2c
commit f2554f1
Showing
48 changed files
with
8,028 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Bump this version to force CI to re-create the cache from scratch. | ||
|
||
06-04-24 | ||
06-07-24 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,4 @@ react* | |
mount-utils | ||
angular | ||
svelte | ||
angular-signals |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ const npmModulesToCopy = [ | |
'vue', | ||
'vue2', | ||
'angular', | ||
'angular-signals', | ||
'svelte', | ||
] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
**/dist | ||
**/*.d.ts | ||
**/package-lock.json | ||
**/tsconfig.json | ||
**/cypress/fixtures |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"plugins": [ | ||
"cypress" | ||
], | ||
"extends": [ | ||
"plugin:@cypress/dev/tests" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
examples | ||
src | ||
cypress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
...require('../../.releaserc'), | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# @cypress/angular-signals | ||
|
||
Mount Angular components in the open source [Cypress.io](https://www.cypress.io/) test runner. This package is an extension of `@cypress/angular`, but with [signals](https://angular.dev/guide/signals) support. | ||
|
||
> **Note:** This package is bundled with the `cypress` package and should not need to be installed separately. See the [Angular Component Testing Docs](https://docs.cypress.io/guides/component-testing/angular/overview) for mounting Angular components. Installing and importing `mount` from `@cypress/angular-signals` should only be done for advanced use-cases. | ||
## Development | ||
|
||
Run `yarn build` to compile and sync packages to the `cypress` cli package. | ||
|
||
## [Changelog](./CHANGELOG.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{ | ||
"name": "@cypress/angular-signals", | ||
"version": "0.0.0-development", | ||
"description": "Test Angular Components using Signals with Cypress", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"prebuild": "rimraf dist", | ||
"build": "rollup -c rollup.config.mjs", | ||
"postbuild": "node ../../scripts/sync-exported-npm-with-cli.js", | ||
"check-ts": "tsc --noEmit", | ||
"dev": "rollup -c rollup.config.mjs -w", | ||
"lint": "eslint --ext .js,.ts,.json, ." | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@angular/common": "^17.2.0", | ||
"@angular/core": "^17.2.0", | ||
"@angular/platform-browser-dynamic": "^17.2.0", | ||
"@cypress/mount-utils": "0.0.0-development", | ||
"typescript": "~5.4.5", | ||
"zone.js": "~0.14.6" | ||
}, | ||
"peerDependencies": { | ||
"@angular/common": ">=17.2", | ||
"@angular/core": ">=17.2", | ||
"@angular/platform-browser-dynamic": ">=17.2", | ||
"rxjs": ">=7.5.0", | ||
"zone.js": ">=0.13.0" | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"types": "dist/index.d.ts", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/cypress-io/cypress.git" | ||
}, | ||
"homepage": "https://github.com/cypress-io/cypress/blob/develop/npm/angular-signals/#readme", | ||
"bugs": "https://github.com/cypress-io/cypress/issues/new?assignees=&labels=npm%3A%20%40cypress%2Fangular&template=1-bug-report.md&title=", | ||
"keywords": [ | ||
"angular", | ||
"cypress", | ||
"cypress-io", | ||
"test", | ||
"testing" | ||
], | ||
"contributors": [ | ||
{ | ||
"name": "Bill Glesias", | ||
"social": "@atofstryker" | ||
} | ||
], | ||
"module": "dist/index.js", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"nx": { | ||
"targets": { | ||
"build": { | ||
"outputs": [ | ||
"{workspaceRoot}/cli/angular-signals" | ||
] | ||
} | ||
} | ||
}, | ||
"standard": { | ||
"globals": [ | ||
"Cypress", | ||
"cy", | ||
"expect" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { createEntries } from '@cypress/mount-utils/create-rollup-entry.mjs' | ||
|
||
const config = { | ||
external: [ | ||
'@angular/core', | ||
'@angular/core/testing', | ||
'@angular/common', | ||
'@angular/platform-browser-dynamic/testing', | ||
'zone.js', | ||
'zone.js/testing', | ||
], | ||
} | ||
|
||
export default createEntries({ formats: ['es'], input: 'src/index.ts', config }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './mount' |
Oops, something went wrong.
f2554f1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
linux x64
version of the Test Runner.Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version
Run this command to install the pre-release locally:
f2554f1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
linux arm64
version of the Test Runner.Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version
Run this command to install the pre-release locally:
f2554f1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
darwin arm64
version of the Test Runner.Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version
Run this command to install the pre-release locally:
f2554f1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
win32 x64
version of the Test Runner.Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version
Run this command to install the pre-release locally:
f2554f1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
darwin x64
version of the Test Runner.Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version
Run this command to install the pre-release locally: