Skip to content

QubitProducts/jest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@qubit/jest

A jest transform to facilitate testing clientside implementations within the qubit platform

Q4M usage

  1. Install with npm install --save-dev @qubit/jest jest@^26
  2. Add this to your package.json
  "scripts": {
    "test": "jest --coverage"
  },
  "jest": {
    "transform": {
      ".*(.js|.css|.less)$": "@qubit/jest"
    },
    "transformIgnorePatterns": []
  }
  1. Create a placement.test.js file You can import the setup tools with const setup = require('@qubit/jest/setup')
  2. Run your test suite with npm test

Q4CX usage

  1. Install with npm install --save-dev @qubit/jest jest@^26
  2. Add this to your package.json
  "scripts": {
    "test": "jest --coverage"
  },
  "jest": {
    "transform": {
      ".*(.js|.css|.less)$": "@qubit/jest"
    },
    "transformIgnorePatterns": []
  }
  1. Create a triggers.test.js, variation-1234.test.js file You can import the setup tools with const setup = require('@qubit/jest/setup/experience')
  2. Run your test suite with npm test

example

See test/placement for an example q4m test suite and test/experience for an example q4cx test suite

Screenshot 2021-04-23 at 16 05 41