{"id":14519,"library":"cypress-angularjs-unit-test","title":"Cypress AngularJS Unit Test Adapter","description":"This package enables unit testing of AngularJS (Angular 1.x) values, services, controllers, and components directly within the Cypress.io test runner. It allows developers to leverage Cypress's powerful features, such as DOM snapshots and time-travel debugging, for individual AngularJS units, providing a comprehensive debugging experience similar to end-to-end tests. The current stable version is 1.2.1, released in April 2018. Given the last release date and its 'BETA' designation in the README, the project appears unmaintained. Its primary differentiator was bringing Cypress's robust E2E testing environment to the unit testing of AngularJS applications. It's crucial to note that AngularJS itself reached End-of-Life (EOL) on December 31, 2021, meaning it no longer receives official updates or security patches, which significantly impacts the relevance and security of this package.","status":"abandoned","version":"1.2.1","language":"javascript","source_language":"en","source_url":"https://github.com/bahmutov/cypress-angularjs-unit-test","tags":["javascript","angularjs","cypress","cypress-io","test","testing"],"install":[{"cmd":"npm install cypress-angularjs-unit-test","lang":"bash","label":"npm"},{"cmd":"yarn add cypress-angularjs-unit-test","lang":"bash","label":"yarn"},{"cmd":"pnpm add cypress-angularjs-unit-test","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required as the core framework for unit testing AngularJS components.","package":"angular","optional":false},{"reason":"Peer dependency required as the underlying test runner for executing unit tests.","package":"cypress","optional":false}],"imports":[{"note":"The `mount` function is a named export, not a default export.","wrong":"import mount from 'cypress-angularjs-unit-test'","symbol":"mount","correct":"import { mount } from 'cypress-angularjs-unit-test'"},{"note":"For CommonJS, `mount` is a named property of the exported object.","wrong":"const mount = require('cypress-angularjs-unit-test')","symbol":"mount (CommonJS)","correct":"const { mount } = require('cypress-angularjs-unit-test')"},{"note":"AngularJS (version 1.x) is typically imported as a default export, or accessed globally as `window.angular`.","wrong":"import { angular } from 'angular'","symbol":"angular","correct":"import angular from 'angular'"}],"quickstart":{"code":"import { mount } from 'cypress-angularjs-unit-test'\nimport angular from 'angular'\n\nangular.module('demo', [])\n  .controller('WelcomeController', function($scope) {\n    $scope.greeting = 'Welcome!';\n    $scope.version = angular.version.full\n  });\n\nbeforeEach(() => {\n  // Let's mount our \"demo\" module and its controller\n  // in a \"mini app\" before each test\n  const template = `\n    <div ng-controller=\"WelcomeController\">\n      {{greeting}}\n      ng {{version}}\n    </div>\n  `\n  mount(template, ['demo'])\n})\n\nit('shows welcome message and Angular version', () => {\n  // \"WelcomeController\" should have replaced template\n  // expression {{greeting}} with actual text\n  cy.contains('div', 'Welcome!').should('be.visible')\n  cy.contains('div', `ng ${angular.version.full}`).should('be.visible')\n  cy.screenshot('welcome-message');\n})","lang":"javascript","description":"This example demonstrates how to define an AngularJS module and controller, then mount a component using `mount` in a Cypress test. It verifies the rendered content with Cypress commands."},"warnings":[{"fix":"Consider migrating to a modern framework like Angular (2+) or React. If migration is not immediately feasible for legacy AngularJS applications, explore extended long-term support (LTS) options from providers like OpenLogic or HeroDevs for security patches and compatibility fixes.","message":"AngularJS, the framework this package is designed for, reached its End-of-Life (EOL) on December 31, 2021. It no longer receives official updates, security patches, or bug fixes from Google. Continuing to use AngularJS, and by extension this testing utility, for production applications without extended third-party support introduces significant security and maintenance risks.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Downgrade Cypress to a version compatible with `^2.1.0` (e.g., Cypress 3.x or lower if possible) or refrain from using this unmaintained package. Modern Cypress (v10+) offers built-in component testing features for frameworks like Angular, which would be the recommended approach for newer Angular applications.","message":"This package specifies `cypress: ^2.1.0` as a peer dependency, but Cypress has undergone numerous major versions and significant breaking changes since its release in 2018. It is highly unlikely to be compatible with modern Cypress versions (e.g., v10+).","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Do not use this package for new projects. For existing legacy AngularJS applications, proceed with caution and be prepared to debug and potentially fork the package for any necessary fixes or adaptations.","message":"The package README explicitly states its 'BETA' status, and it has not been updated since April 2018. This indicates it was never considered stable and is currently unmaintained, meaning there will be no new features, bug fixes, or compatibility updates for newer Node.js versions, Cypress, or even AngularJS itself (post-EOL).","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Install AngularJS as a project dependency: `npm install angular@^1.6.9 --save-dev`.","cause":"The `angular` peer dependency is missing from your project's `package.json` or not installed.","error":"Error: Cannot find module 'angular'"},{"fix":"Ensure your `cypress.json` and `cypress/plugins/index.js` are configured correctly if using an older Cypress. However, the core issue is likely the overall age and incompatibility with modern tooling. Consider alternatives for testing.","cause":"This error or similar issues might arise due to incompatibility between very old Cypress versions and modern development server setups, or missing Webpack configurations required by older Cypress component testing setups.","error":"Cypress encountered an unexpected error: Cannot find module 'webpack-dev-server/client/index.js' from ..."},{"fix":"Change your import statement from `import mount from 'cypress-angularjs-unit-test'` to `import { mount } from 'cypress-angularjs-unit-test'` for ESM, or use `const { mount } = require('cypress-angularjs-unit-test')` for CommonJS.","cause":"You are likely using an incorrect import statement, attempting to import `mount` as a default export when it is a named export.","error":"TypeError: (0 , cypress_angularjs_unit_test__WEBPACK_IMPORTED_MODULE_0__.mount) is not a function"}],"ecosystem":"npm"}