Skip to content

Instantly share code, notes, and snippets.

@wilmoore
Last active June 22, 2022 15:02
Show Gist options
  • Select an option

  • Save wilmoore/f8c9ed687ae67f9d1b2905eb3e7d50b6 to your computer and use it in GitHub Desktop.

Select an option

Save wilmoore/f8c9ed687ae67f9d1b2905eb3e7d50b6 to your computer and use it in GitHub Desktop.
Income Sources :: Books :: Switching from Jest to Mocha, Chai, Sinon

Income Sources :: Books :: Switching from Jest to Mocha, Chai, Sinon

⪼ Made with 💜 by realpolyglot.dev

About

The assignment is to switch a TypeScript project from Jest to Mocha, Chai, and Sinon. You might be wondering why anyone would want to do that; however, it doesn't matter. Sometimes, that is the assignment. Roger that. Let's go:

npm uninstall --save-dev @jest/types @swc-node/jest @types/jest jest jest-junit
npm install --save-dev ts-sinon mocha mocha-typescript @types/mocha mocha-junit-reporter sinon @types/sinon chai @types/chai chai-as-promised @types/chai-as-promised mochawesome should nyc
package.json
  "nyc": {
    "extension": [
      ".ts",
      ".tsx"
    ],
    "exclude": [
      "**/*.d.ts",
      "**/*.spec.ts",
      "**/test/**",
      "**/gen/**",
      "public/**",
      "**/utils/**",
      "src/Main.ts"
    ],
    "all": true,
    "reporter": [
      "html",
      "text"
    ],
    "report-dir": "./public"
  },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment