Skip to content

Latest commit

 

History

History
51 lines (39 loc) · 1.33 KB

README.md

File metadata and controls

51 lines (39 loc) · 1.33 KB

@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