cypress 15.21.0 → 15.21.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/bin/cypress +1 -1
  2. package/dist/{cli-_xePNEPj.js → cli-Bq37KsfF.js} +14 -3
  3. package/dist/cli.js +1 -1
  4. package/dist/{cypress-DCSAOi2D.js → cypress-afrMJjAu.js} +1 -1
  5. package/dist/cypress.js +2 -2
  6. package/dist/index.js +2 -2
  7. package/dist/{tap-BkTD6Abc.js → tap-M6WV-Whx.js} +34 -12
  8. package/package.json +4 -4
  9. package/angular/angular/README.md +0 -15
  10. package/angular/angular/dist/index.d.ts +0 -136
  11. package/angular/angular/dist/index.js +0 -493
  12. package/angular/angular/package.json +0 -83
  13. package/angular-zoneless/angular-zoneless/README.md +0 -15
  14. package/angular-zoneless/angular-zoneless/dist/index.d.ts +0 -119
  15. package/angular-zoneless/angular-zoneless/dist/index.js +0 -482
  16. package/angular-zoneless/angular-zoneless/package.json +0 -74
  17. package/mount-utils/mount-utils/README.md +0 -140
  18. package/mount-utils/mount-utils/dist/index.d.ts +0 -12
  19. package/mount-utils/mount-utils/dist/index.js +0 -41
  20. package/mount-utils/mount-utils/package.json +0 -52
  21. package/react/react/README.md +0 -19
  22. package/react/react/dist/cypress-react.cjs.js +0 -293
  23. package/react/react/dist/cypress-react.esm-bundler.js +0 -268
  24. package/react/react/dist/index.d.ts +0 -94
  25. package/react/react/package.json +0 -113
  26. package/svelte/svelte/README.md +0 -19
  27. package/svelte/svelte/dist/cypress-svelte.cjs.js +0 -122
  28. package/svelte/svelte/dist/cypress-svelte.esm-bundler.js +0 -120
  29. package/svelte/svelte/dist/index.d.ts +0 -30
  30. package/svelte/svelte/package.json +0 -63
  31. package/vue/vue/README.md +0 -14
  32. package/vue/vue/dist/cypress-vue.cjs.js +0 -8696
  33. package/vue/vue/dist/cypress-vue.esm-bundler.js +0 -8675
  34. package/vue/vue/dist/index.d.ts +0 -1375
  35. package/vue/vue/package.json +0 -97
@@ -1,493 +0,0 @@
1
-
2
- /**
3
- * @cypress/angular v0.0.0-development
4
- * (c) 2026 Cypress.io
5
- * Released under the MIT License
6
- */
7
-
8
- import 'zone.js';
9
- import 'zone.js/testing';
10
- import { CommonModule } from '@angular/common';
11
- import { Injectable, Component, EventEmitter, ErrorHandler, SimpleChange } from '@angular/core';
12
- import { toObservable } from '@angular/core/rxjs-interop';
13
- import { getTestBed, TestComponentRenderer, TestBed } from '@angular/core/testing';
14
- import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
15
-
16
- /******************************************************************************
17
- Copyright (c) Microsoft Corporation.
18
-
19
- Permission to use, copy, modify, and/or distribute this software for any
20
- purpose with or without fee is hereby granted.
21
-
22
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
23
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
24
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
25
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
26
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
27
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
28
- PERFORMANCE OF THIS SOFTWARE.
29
- ***************************************************************************** */
30
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
31
-
32
-
33
- function __rest(s, e) {
34
- var t = {};
35
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
36
- t[p] = s[p];
37
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
38
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
39
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
40
- t[p[i]] = s[p[i]];
41
- }
42
- return t;
43
- }
44
-
45
- function __decorate(decorators, target, key, desc) {
46
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
47
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
48
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
49
- return c > 3 && r && Object.defineProperty(target, key, r), r;
50
- }
51
-
52
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
53
- var e = new Error(message);
54
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
55
- };
56
-
57
- const ROOT_SELECTOR = '[data-cy-root]';
58
- /**
59
- * Gets the root element used to mount the component.
60
- * @returns {HTMLElement} The root element
61
- * @throws {Error} If the root element is not found
62
- */
63
- const getContainerEl = () => {
64
- const el = document.querySelector(ROOT_SELECTOR);
65
- if (el) {
66
- return el;
67
- }
68
- throw Error(`No element found that matches selector ${ROOT_SELECTOR}. Please add a root element with data-cy-root attribute to your "component-index.html" file so that Cypress can attach your component to the DOM.`);
69
- };
70
- /**
71
- * Utility function to register CT side effects and run cleanup code during the "test:before:run" Cypress hook
72
- * @param optionalCallback Callback to be called before the next test runs
73
- */
74
- function setupHooks(optionalCallback) {
75
- // We don't want CT side effects to run when e2e
76
- // testing so we early return.
77
- // System test to verify CT side effects do not pollute e2e: system-tests/test/e2e_with_mount_import_spec.ts
78
- if (Cypress.testingType !== 'component') {
79
- return;
80
- }
81
- // When running component specs, we cannot allow "cy.visit"
82
- // because it will wipe out our preparation work, and does not make much sense
83
- // thus we overwrite "cy.visit" to throw an error
84
- Cypress.Commands.overwrite('visit', () => {
85
- throw new Error('cy.visit from a component spec is not allowed');
86
- });
87
- Cypress.Commands.overwrite('session', () => {
88
- throw new Error('cy.session from a component spec is not allowed');
89
- });
90
- Cypress.Commands.overwrite('origin', () => {
91
- throw new Error('cy.origin from a component spec is not allowed');
92
- });
93
- // @ts-ignore
94
- Cypress.on('test:before:after:run:async', () => {
95
- optionalCallback === null || optionalCallback === void 0 ? void 0 : optionalCallback();
96
- });
97
- }
98
-
99
- /**
100
- * @hack fixes "Mocha has already been patched with Zone" error.
101
- */
102
- // @ts-ignore
103
- window.Mocha['__zone_patch__'] = false;
104
- let activeFixture = null;
105
- let activeInternalSubscriptions = [];
106
- function cleanup() {
107
- // Not public, we need to call this to remove the last component from the DOM
108
- try {
109
- getTestBed().tearDownTestingModule();
110
- }
111
- catch (e) {
112
- const notSupportedError = new Error(`Failed to teardown component. The version of Angular you are using may not be officially supported.`);
113
- notSupportedError.docsUrl = 'https://on.cypress.io/frameworks';
114
- throw notSupportedError;
115
- }
116
- // clean up internal subscriptions if any exist. We use this for two-way data binding for
117
- // signal() models
118
- activeInternalSubscriptions.forEach((subscription) => {
119
- subscription.unsubscribe();
120
- });
121
- getTestBed().resetTestingModule();
122
- activeFixture = null;
123
- activeInternalSubscriptions = [];
124
- }
125
- let CypressAngularErrorHandler = class CypressAngularErrorHandler {
126
- handleError(error) {
127
- throw error;
128
- }
129
- };
130
- CypressAngularErrorHandler = __decorate([
131
- Injectable()
132
- ], CypressAngularErrorHandler);
133
- /**
134
- * Bootstraps the TestModuleMetaData passed to the TestBed
135
- *
136
- * @param {Type<T>} component Angular component being mounted
137
- * @param {MountConfig} config TestBed configuration passed into the mount function
138
- * @returns {MountConfig} MountConfig
139
- */
140
- function bootstrapModule(component, config) {
141
- var _a;
142
- const { componentProperties } = config, testModuleMetaData = __rest(config, ["componentProperties"]);
143
- if (!testModuleMetaData.declarations) {
144
- testModuleMetaData.declarations = [];
145
- }
146
- if (!testModuleMetaData.imports) {
147
- testModuleMetaData.imports = [];
148
- }
149
- if (!testModuleMetaData.providers) {
150
- testModuleMetaData.providers = [];
151
- }
152
- // Replace default error handler since it will swallow uncaught exceptions.
153
- // We want these to be uncaught so Cypress catches it and fails the test
154
- testModuleMetaData.providers.push({
155
- provide: ErrorHandler,
156
- useClass: CypressAngularErrorHandler,
157
- });
158
- // check if the component is a standalone component
159
- if ((_a = component.ɵcmp) === null || _a === void 0 ? void 0 : _a.standalone) {
160
- testModuleMetaData.imports.push(component);
161
- }
162
- else {
163
- testModuleMetaData.declarations.push(component);
164
- }
165
- if (!testModuleMetaData.imports.includes(CommonModule)) {
166
- testModuleMetaData.imports.push(CommonModule);
167
- }
168
- return testModuleMetaData;
169
- }
170
- let CypressTestComponentRenderer = class CypressTestComponentRenderer extends TestComponentRenderer {
171
- insertRootElement(rootElId) {
172
- this.removeAllRootElements();
173
- const rootElement = getContainerEl();
174
- rootElement.setAttribute('id', rootElId);
175
- }
176
- removeAllRootElements() {
177
- getContainerEl().innerHTML = '';
178
- }
179
- };
180
- CypressTestComponentRenderer = __decorate([
181
- Injectable()
182
- ], CypressTestComponentRenderer);
183
- /**
184
- * Initializes the TestBed
185
- *
186
- * @param {Type<T> | string} component Angular component being mounted or its template
187
- * @param {MountConfig} config TestBed configuration passed into the mount function
188
- * @returns {Type<T>} componentFixture
189
- */
190
- function initTestBed(component, config) {
191
- const componentFixture = createComponentFixture(component);
192
- getTestBed().configureTestingModule(Object.assign({}, bootstrapModule(componentFixture, config)));
193
- getTestBed().overrideProvider(TestComponentRenderer, { useValue: new CypressTestComponentRenderer() });
194
- return componentFixture;
195
- }
196
- // if using the Wrapper Component (template strings), the component itself cannot be
197
- // a standalone component
198
- let WrapperComponent = class WrapperComponent {
199
- };
200
- WrapperComponent = __decorate([
201
- Component({ selector: 'cy-wrapper-component', template: '', standalone: false })
202
- ], WrapperComponent);
203
- /**
204
- * Returns the Component if Type<T> or creates a WrapperComponent
205
- *
206
- * @param {Type<T> | string} component The component you want to create a fixture of
207
- * @returns {Type<T> | WrapperComponent}
208
- */
209
- function createComponentFixture(component) {
210
- if (typeof component === 'string') {
211
- // getTestBed().overrideTemplate is available in v14+
212
- // The static TestBed.overrideTemplate is available across versions
213
- TestBed.overrideTemplate(WrapperComponent, component);
214
- return WrapperComponent;
215
- }
216
- return component;
217
- }
218
- /**
219
- * Creates the ComponentFixture
220
- *
221
- * @param {Type<T>} component Angular component being mounted
222
- * @param {MountConfig<T>} config MountConfig
223
-
224
- * @returns {ComponentFixture<T>} ComponentFixture
225
- */
226
- function setupFixture(component, config) {
227
- const fixture = getTestBed().createComponent(component);
228
- setupComponent(config, fixture);
229
- fixture.whenStable().then(() => {
230
- var _a;
231
- fixture.autoDetectChanges((_a = config.autoDetectChanges) !== null && _a !== void 0 ? _a : true);
232
- }).catch((e) => {
233
- // If this promise does not settle in Angular 19 it is rejected
234
- // https://github.com/angular/angular/blob/main/CHANGELOG.md#1900-2024-11-19
235
- // eslint-disable-next-line no-console
236
- console.error(e);
237
- });
238
- return fixture;
239
- }
240
- // Best known way to currently detect whether or not a function is a signal is if the signal symbol exists.
241
- // From there, we can take our best guess based on what exists on the object itself.
242
- // @see https://github.com/cypress-io/cypress/issues/29731.
243
- function isSignal(prop) {
244
- try {
245
- const symbol = Object.getOwnPropertySymbols(prop).find((symbol) => symbol.toString() === 'Symbol(SIGNAL)');
246
- return !!symbol;
247
- }
248
- catch (e) {
249
- // likely a primitive type, object, array, or something else (i.e. not a signal).
250
- // We can return false here.
251
- return false;
252
- }
253
- }
254
- // currently not a great way to detect if a function is an InputSignal.
255
- // @see https://github.com/cypress-io/cypress/issues/29731.
256
- function isInputSignal(prop) {
257
- return isSignal(prop) && typeof prop === 'function' && prop['name'] === 'inputValueFn';
258
- }
259
- // currently not a great way to detect if a function is a Model Signal.
260
- // @see https://github.com/cypress-io/cypress/issues/29731.
261
- function isModelSignal(prop) {
262
- return isSignal(prop) && isWritableSignal(prop) && typeof prop.subscribe === 'function';
263
- }
264
- // currently not a great way to detect if a function is a Writable Signal.
265
- // @see https://github.com/cypress-io/cypress/issues/29731.
266
- function isWritableSignal(prop) {
267
- return isSignal(prop) && typeof prop === 'function' && typeof prop.set === 'function';
268
- }
269
- function registerSignalEventsIfNeeded(propKey, propValue, componentValue, injector, fixture) {
270
- const isPropValueASignal = isSignal(propValue);
271
- if (isPropValueASignal) {
272
- // propValue -> componentValue
273
- const convertedToObservable = toObservable(propValue, {
274
- injector,
275
- });
276
- // push the subscription into an array to be cleaned up at the end of the test
277
- // to prevent a memory leak
278
- activeInternalSubscriptions.push(convertedToObservable.subscribe((value) => {
279
- // keep the component up to date as prop signal changes
280
- fixture.componentRef.setInput(propKey, value);
281
- }));
282
- }
283
- const isComponentValueAModelSignal = isModelSignal(componentValue);
284
- if (isPropValueASignal && isComponentValueAModelSignal) {
285
- // propValue <- componentValue
286
- const modelChanged$ = toObservable(componentValue, {
287
- injector,
288
- });
289
- activeInternalSubscriptions.push(modelChanged$.subscribe((value) => {
290
- propValue.set(value);
291
- }));
292
- }
293
- }
294
- // In the case of signals, if we need to create an output spy, we need to check first whether or not a user has one defined first or has it created through
295
- // autoSpyOutputs. If so, we need to subscribe to the writable signal to push updates into the event emitter. We do NOT observe input signals and output spies will not
296
- // work for input signals.
297
- function detectAndRegisterOutputSpyToSignal(config, component, key, injector) {
298
- if (config.componentProperties) {
299
- const expectedChangeKey = `${key}Change`;
300
- let changeKeyIfExists = !!Object.keys(config.componentProperties).find((componentKey) => componentKey === expectedChangeKey);
301
- if (changeKeyIfExists) {
302
- component[expectedChangeKey] =
303
- // @ts-expect-error
304
- config.componentProperties[expectedChangeKey];
305
- }
306
- // since spies do NOT make change handlers by default, similar to the Output() decorator, we need to create the spy and subscribe to the signal
307
- if (!changeKeyIfExists && config.autoSpyOutputs) {
308
- component[expectedChangeKey] = createOutputSpy(`${expectedChangeKey}Spy`);
309
- changeKeyIfExists = true;
310
- }
311
- if (changeKeyIfExists) {
312
- const componentValue = component[key];
313
- // if the user passed in a change key or we created one due to config.autoSpyOutputs being set to true for a given signal,
314
- // we will create a subscriber that will emit an event every time the value inside the signal changes. We only do this
315
- // if the signal is writable and not an input signal.
316
- if (isWritableSignal(componentValue) && !isInputSignal(componentValue)) {
317
- activeInternalSubscriptions.push(toObservable(componentValue, {
318
- injector,
319
- }).subscribe((value) => {
320
- var _a;
321
- (_a = component[expectedChangeKey]) === null || _a === void 0 ? void 0 : _a.emit(value);
322
- }));
323
- }
324
- }
325
- }
326
- }
327
- /**
328
- * Gets the componentInstance and Object.assigns any componentProperties() passed in the MountConfig
329
- *
330
- * @param {MountConfig} config TestBed configuration passed into the mount function
331
- * @param {ComponentFixture<T>} fixture Fixture for debugging and testing a component.
332
- * @returns {T} Component being mounted
333
- */
334
- function setupComponent(config, fixture) {
335
- let component = fixture.componentInstance;
336
- const injector = fixture.componentRef.injector;
337
- if (config === null || config === void 0 ? void 0 : config.componentProperties) {
338
- if (component instanceof WrapperComponent) {
339
- component = Object.assign(component, config.componentProperties);
340
- }
341
- getComponentInputs(fixture.componentRef.componentType).forEach((key) => {
342
- var _a;
343
- // only assign props if they are passed into the component
344
- if ((_a = config === null || config === void 0 ? void 0 : config.componentProperties) === null || _a === void 0 ? void 0 : _a.hasOwnProperty(key)) {
345
- // @ts-expect-error
346
- const passedInValue = config === null || config === void 0 ? void 0 : config.componentProperties[key];
347
- registerSignalEventsIfNeeded(key, passedInValue, component[key], injector, fixture);
348
- detectAndRegisterOutputSpyToSignal(config, component, key, injector);
349
- fixture.componentRef.setInput(key, isSignal(passedInValue) ? passedInValue() : passedInValue);
350
- }
351
- });
352
- getComponentOutputs(fixture.componentRef.componentType).forEach((key) => {
353
- var _a, _b;
354
- const property = component[key];
355
- // With the introduction of https://github.com/cypress-io/cypress/pull/31993, we want to make sure that component inputs are reference safe inside cy.mount().
356
- // However, the exception to this is if the user passes in a Cypress output spy as a property in order to maintain backwards compatibility.
357
- // @ts-expect-error
358
- if (property instanceof EventEmitter || (((_a = config === null || config === void 0 ? void 0 : config.componentProperties) === null || _a === void 0 ? void 0 : _a.hasOwnProperty(key)) && (config === null || config === void 0 ? void 0 : config.componentProperties[key]) instanceof EventEmitter)) {
359
- // only assign props if they are passed into the component
360
- if ((_b = config === null || config === void 0 ? void 0 : config.componentProperties) === null || _b === void 0 ? void 0 : _b.hasOwnProperty(key)) {
361
- // @ts-expect-error
362
- const passedInValue = config === null || config === void 0 ? void 0 : config.componentProperties[key];
363
- component[key] = passedInValue;
364
- }
365
- }
366
- });
367
- }
368
- if (config.autoSpyOutputs) {
369
- Object.keys(component).forEach((key) => {
370
- const property = component[key];
371
- if (property instanceof EventEmitter) {
372
- component[key] = createOutputSpy(`${key}Spy`);
373
- }
374
- });
375
- }
376
- // Manually call ngOnChanges when mounting components using the class syntax.
377
- // This is necessary because we are assigning input values to the class directly
378
- // on mount and therefore the ngOnChanges() lifecycle is not triggered.
379
- if (component.ngOnChanges && config.componentProperties) {
380
- const { componentProperties } = config;
381
- const simpleChanges = Object.entries(componentProperties).reduce((acc, [key, value]) => {
382
- acc[key] = new SimpleChange(null, value, true);
383
- return acc;
384
- }, {});
385
- if (Object.keys(componentProperties).length > 0) {
386
- component.ngOnChanges(simpleChanges);
387
- }
388
- }
389
- }
390
- /**
391
- * Gets the input properties of a component - cannot rely on Object.keys() because inclusion of optional properties depends on useDefineForClassFields=true
392
- * Since Angular 15, useDefineForClassFields=false
393
- * @param componentType
394
- * @returns array of input property names
395
- */
396
- function getComponentInputs(componentType) {
397
- var _a;
398
- // Access Angular's metadata to get input properties
399
- const propMetadata = ((_a = componentType.ɵcmp) === null || _a === void 0 ? void 0 : _a.inputs) || {};
400
- return Object.keys(propMetadata);
401
- }
402
- function getComponentOutputs(componentType) {
403
- var _a;
404
- // Access Angular's metadata to get output properties
405
- const propMetadata = ((_a = componentType.ɵcmp) === null || _a === void 0 ? void 0 : _a.outputs) || {};
406
- return Object.keys(propMetadata);
407
- }
408
- /**
409
- * Mounts an Angular component inside Cypress browser
410
- *
411
- * @param component Angular component being mounted or its template
412
- * @param config configuration used to configure the TestBed
413
- * @example
414
- * import { mount } from '@cypress/angular'
415
- * import { StepperComponent } from './stepper.component'
416
- * import { MyService } from 'services/my.service'
417
- * import { SharedModule } from 'shared/shared.module';
418
- * it('mounts', () => {
419
- * mount(StepperComponent, {
420
- * providers: [MyService],
421
- * imports: [SharedModule]
422
- * })
423
- * cy.get('[data-cy=increment]').click()
424
- * cy.get('[data-cy=counter]').should('have.text', '1')
425
- * })
426
- *
427
- * // or
428
- *
429
- * it('mounts with template', () => {
430
- * mount('<app-stepper></app-stepper>', {
431
- * declarations: [StepperComponent],
432
- * })
433
- * })
434
- *
435
- * @see {@link https://on.cypress.io/mounting-angular} for more details.
436
- *
437
- * @returns A component and component fixture
438
- */
439
- function mount(component, config = {}) {
440
- // Remove last mounted component if cy.mount is called more than once in a test
441
- if (activeFixture) {
442
- cleanup();
443
- }
444
- const componentFixture = initTestBed(component, config);
445
- activeFixture = setupFixture(componentFixture, config);
446
- const mountResponse = {
447
- fixture: activeFixture,
448
- component: activeFixture.componentInstance,
449
- };
450
- const logMessage = typeof component === 'string' ? 'Component' : componentFixture.name;
451
- Cypress.log({
452
- name: 'mount',
453
- message: logMessage,
454
- consoleProps: () => ({ result: mountResponse }),
455
- });
456
- return cy.wrap(mountResponse, { log: false });
457
- }
458
- /**
459
- * Creates a new Event Emitter and then spies on it's `emit` method
460
- *
461
- * @param {string} alias name you want to use for your cy.spy() alias
462
- * @returns EventEmitter<T>
463
- * @example
464
- * import { StepperComponent } from './stepper.component'
465
- * import { mount, createOutputSpy } from '@cypress/angular'
466
- *
467
- * it('Has spy', () => {
468
- * mount(StepperComponent, { componentProperties: { change: createOutputSpy('changeSpy') } })
469
- * cy.get('[data-cy=increment]').click()
470
- * cy.get('@changeSpy').should('have.been.called')
471
- * })
472
- *
473
- * // Or for use with Angular Signals following the output nomenclature.
474
- * // see https://v17.angular.io/guide/model-inputs#differences-between-model-and-input/
475
- *
476
- * it('Has spy', () => {
477
- * mount(StepperComponent, { componentProperties: { count: signal(0), countChange: createOutputSpy('countChange') } })
478
- * cy.get('[data-cy=increment]').click()
479
- * cy.get('@countChange').should('have.been.called')
480
- * })
481
- */
482
- const createOutputSpy = (alias) => {
483
- const emitter = new EventEmitter();
484
- cy.spy(emitter, 'emit').as(alias);
485
- return emitter;
486
- };
487
- // Only needs to run once, we reset before each test
488
- getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
489
- teardown: { destroyAfterEach: false },
490
- });
491
- setupHooks(cleanup);
492
-
493
- export { CypressTestComponentRenderer, createOutputSpy, mount };
@@ -1,83 +0,0 @@
1
- {
2
- "name": "@cypress/angular",
3
- "version": "0.0.0-development",
4
- "description": "Test Angular Components with Cypress",
5
- "main": "dist/index.js",
6
- "scripts": {
7
- "prebuild": "rimraf dist",
8
- "build": "rollup -c rollup.config.mjs",
9
- "postbuild": "node ../../scripts/sync-exported-npm-with-cli.js",
10
- "check-ts": "tsc --noEmit",
11
- "dev": "rollup -c rollup.config.mjs -w",
12
- "lint": "eslint --ext .js,.ts,.json, ."
13
- },
14
- "dependencies": {},
15
- "devDependencies": {
16
- "@angular/common": "^18.0.0",
17
- "@angular/core": "^18.0.0",
18
- "@angular/platform-browser-dynamic": "^18.0.0",
19
- "@cypress/mount-utils": "0.0.0-development",
20
- "rollup": "^4.24.4",
21
- "typescript": "~5.4.5",
22
- "zone.js": "~0.14.6"
23
- },
24
- "peerDependencies": {
25
- "@angular/common": ">=18.0.0",
26
- "@angular/core": ">=18.0.0",
27
- "@angular/platform-browser-dynamic": ">=18.0.0",
28
- "rxjs": ">=7.5.0",
29
- "zone.js": ">=0.14.0"
30
- },
31
- "files": [
32
- "dist"
33
- ],
34
- "types": "dist/index.d.ts",
35
- "license": "MIT",
36
- "repository": {
37
- "type": "git",
38
- "url": "https://github.com/cypress-io/cypress.git"
39
- },
40
- "homepage": "https://github.com/cypress-io/cypress/blob/develop/npm/angular/#readme",
41
- "bugs": "https://github.com/cypress-io/cypress/issues/new?assignees=&labels=npm%3A%20%40cypress%2Fangular&template=1-bug-report.md&title=",
42
- "keywords": [
43
- "angular",
44
- "cypress",
45
- "cypress-io",
46
- "test",
47
- "testing"
48
- ],
49
- "contributors": [
50
- {
51
- "name": "Bill Glesias",
52
- "social": "@atofstryker"
53
- },
54
- {
55
- "name": "Jordan Powell",
56
- "social": "@jordanpowell88"
57
- },
58
- {
59
- "name": "Zach Williams",
60
- "social": "@ZachJW34"
61
- }
62
- ],
63
- "module": "dist/index.js",
64
- "publishConfig": {
65
- "access": "public"
66
- },
67
- "nx": {
68
- "targets": {
69
- "build": {
70
- "outputs": [
71
- "{workspaceRoot}/cli/angular"
72
- ]
73
- }
74
- }
75
- },
76
- "standard": {
77
- "globals": [
78
- "Cypress",
79
- "cy",
80
- "expect"
81
- ]
82
- }
83
- }
@@ -1,15 +0,0 @@
1
- # @cypress/angular-zoneless
2
-
3
- Mount Angular components in the open source [Cypress.io](https://www.cypress.io/) test runner without leveraging zone.js for change detection
4
-
5
- > **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-zoneless` should only be done for advanced use-cases.
6
-
7
- ## Requirements
8
-
9
- - Angular 21.0.0 or Angular 20.0.0 with development preview of zoneless change detection
10
-
11
- ## Development
12
-
13
- Run `yarn build` to compile and sync packages to the `cypress` cli package.
14
-
15
- ## [Changelog](./CHANGELOG.md)