All Projects → briebug → Jest Schematic

briebug / Jest Schematic

Licence: mit
Angular schematic for adding Jest and the required files to an Angular CLI project

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Jest Schematic

Nxplorerjs Microservice Starter
Node JS , Typescript , Express based reactive microservice starter project for REST and GraphQL APIs
Stars: ✭ 193 (-13.84%)
Mutual labels:  jest
Root Cause
🔍 Root Cause is a tool for troubleshooting Puppeteer and Playwright tests. 🔎
Stars: ✭ 205 (-8.48%)
Mutual labels:  jest
Awesome Learning
Awesome Learning - Learn JavaScript and Front-End Fundamentals at your own pace
Stars: ✭ 216 (-3.57%)
Mutual labels:  jest
Jest Native
🦅 Custom jest matchers to test the state of React Native
Stars: ✭ 196 (-12.5%)
Mutual labels:  jest
Vuesion
Vuesion is a boilerplate that helps product teams build faster than ever with fewer headaches and modern best practices across engineering & design.
Stars: ✭ 2,510 (+1020.54%)
Mutual labels:  jest
Front End Guide
📚 Study guide and introduction to the modern front end stack.
Stars: ✭ 14,073 (+6182.59%)
Mutual labels:  jest
Quickshare
Quick and simple file sharing between different devices.
Stars: ✭ 190 (-15.18%)
Mutual labels:  jest
Jsdom Worker
👷‍♀️ Use Web Workers in Jest / JSDOM 🌈
Stars: ✭ 218 (-2.68%)
Mutual labels:  jest
Learning React
The code samples for Learning React by Alex Banks and Eve Porcello, published by O'Reilly Media
Stars: ✭ 2,705 (+1107.59%)
Mutual labels:  jest
Aspnetcore Vue Typescript Template
Template AspNetCore with Vue, Vue router, Vuex, TypeScript, Bulma, Sass and Jest
Stars: ✭ 215 (-4.02%)
Mutual labels:  jest
Weekly Digest
Weekly summary of activity on your GitHub repository 📆
Stars: ✭ 199 (-11.16%)
Mutual labels:  jest
Express Graphql Boilerplate
Express GraphQL API with JWT Authentication and support for sqlite, mysql, and postgresql
Stars: ✭ 201 (-10.27%)
Mutual labels:  jest
Testdeck
Object oriented testing
Stars: ✭ 206 (-8.04%)
Mutual labels:  jest
100 Days Of Code Frontend
Curriculum for learning front-end development during #100DaysOfCode.
Stars: ✭ 2,419 (+979.91%)
Mutual labels:  jest
Modern Node
All-in-one development toolkit for creating node modules with Jest, Prettier, ESLint, and Standard
Stars: ✭ 216 (-3.57%)
Mutual labels:  jest
Jest Canvas Mock
🌗 A module used to mock canvas in Jest.
Stars: ✭ 189 (-15.62%)
Mutual labels:  jest
Jest Dom
🦉 Custom jest matchers to test the state of the DOM
Stars: ✭ 2,908 (+1198.21%)
Mutual labels:  jest
Testing React Redux With Jest And Enzyme
React Redux Testing Template using Jest and Enzyme
Stars: ✭ 224 (+0%)
Mutual labels:  jest
Svelte Boilerplate
Svelte application boilerplate with Webpack, Babel, PostCSS, Sass, Fetch, Jest, .Env, EsLint.
Stars: ✭ 216 (-3.57%)
Mutual labels:  jest
Buefy Shop
A sample shop built with Nuxt, Stripe, Firebase and Serverless Functions
Stars: ✭ 207 (-7.59%)
Mutual labels:  jest

Jest Angular Schematic

This schematic will configure Angular to execute unit tests with Jest for single projects or workspaces.

npm (scoped)

Usage 🚀

ng add @briebug/jest-schematic
  • install Jest, types and a builder
  • add Jest configuration files
  • remove Karma & Jasmine along with their configuration files

Optionally: install globally

npm install -g @briebug/jest-schematic

Then in an Angular CLI project run

ng g @briebug/jest-schematic:add

jest-schematic-demo-500

Issues 🧐

If you're experiencing issues when trying to run your tests with Jest, please view the documentation for the builder which uses jest-preset-angular.

A common issues involves library dependencies. For example if your app depends on NgRx you'll need to tell Jest to compile the sources explicitly by appending it to the transformIgnorePatterns property in the jest.config.js file.

module.exports = {
  transformIgnorePatterns: ['node_modules/(?!(jest-test|@ngrx))'],
};

Issues with this schematic can be filed here.

Learning Resources 📚

Development 🛠

Getting started

Clone or fork the repo and install the dependencies with Yarn

yarn

Test schematic changes against a sandbox app

When running locally, schematic changes will be applied to a test app in the /sandboxes directory. /sandboxes contain a single app repo and a workspace repo with an application and library.

Run the following when a schematic change is made to test:

// runs against /sandboxes/single-app
yarn test single

// runs against /sandboxes/workspace
yarn test workspace

Be careful not to check in changes to the sandbox directory unless necessary.

Reset sandboxes to their version controlled state

This will reset the sandboxes to their HEAD commit and remove un-tracked files.

yarn reset

Test schematics against a local project

  • run yarn build to compile the schematic in watch mode
  • open another shell, cd into the local repo you want to run the schematic against, and run yarn link @briebug/jest-schematic. This assumes you've run yarn link in this repo on your machine.
    • this will symlink the projects so that the Jest schematic command runs from you're local filesystem
  • in the local repo you want to run the schematic against, run ng g @briebug/jest-schematic:add

Dev tips

For faster developing, find and comment out the following line to avoid npm installing dependencies

context.addTask(new NodePackageInstallTask());
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].