Skip to content

Instantly share code, notes, and snippets.

@josmas
Last active November 25, 2023 21:46
Show Gist options
  • Save josmas/0f1ee69af92ac30742651e106a9db7ee to your computer and use it in GitHub Desktop.
Save josmas/0f1ee69af92ac30742651e106a9db7ee to your computer and use it in GitHub Desktop.
Starter instrucstions for TDD rounds

if you want to use --watch with jest, you need to initialize a git repo

    cd /tmp
    mkdir delete_me_after_round
    cd delete_me_after_round
    npm init --y
    git init
    npm install jest

modify the test script in package.json

"test": "jest --watch"

create a index.test.js file with the following contents

    // make sure the file extension is .test.js
    it('should fail', () => { expect(true).toBe(false) });

run tests in watch mode

npm test

After each round, close all files and...

    cd ../
    rm -rf delete_me_after_round/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment