Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 2.16 KB

File metadata and controls

35 lines (23 loc) · 2.16 KB

Input / Output testing

Author: Thomas Laforge

Statement:

We have a small counter application that increment or decrement a number. You can play with it by running : npx nx serve testing-input-output.

The goal is to test CounterComponent with Testing library and Cypress

The file named counter.component.spec.ts will let test your application using Testing Library. To run the test suits, you need to run npx nx test testing-nested. You can also install Jest Runner to execute your test by clicking on the Run button above each describe or it blocks.

For testing cypress, you will execute your test inside the counter.component.cy.ts and run npx nx component-test testing-nested to execute your test suits. You can add the --watch flag to execute your test in watch mode.

I created some it blocks but feel free to add more test if you like to.

Submitting your work

  1. Fork the project
  2. clone it
  3. npm ci
  4. npx nx serve testing-input-output to play with the application
  5. npx nx test testing-input-output to test your application with Testing Library
  6. npx nx component-test testing-input-output --watch to test your application with Cypress
  7. ...work on it
  8. Commit your work
  9. Submit a PR with a title beginning with Answer:19 that I will review and other dev can review.

input output testing input output testing solution author

You can ask any question on twitter