Skip to content

Instantly share code, notes, and snippets.

@lorenzofox3
Created May 10, 2021 13:51
Show Gist options
  • Save lorenzofox3/81c201346b28239b477643b1119bbbe9 to your computer and use it in GitHub Desktop.
Save lorenzofox3/81c201346b28239b477643b1119bbbe9 to your computer and use it in GitHub Desktop.

Revisions

  1. lorenzofox3 created this gist May 10, 2021.
    20 changes: 20 additions & 0 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    {
    "name": "zora-coverage",
    "version": "1.0.0",
    "description": "",
    "main": "index.js",
    "scripts": {
    "test": "ts-node sum.spec.ts",
    "test:only": "RUN_ONLY=true ts-node sum.spec.ts",
    "test:coverage": "c8 --exclude to-be-excluded.ts ts-node sum.spec.ts",
    "dev": "nodemon sum.spec.ts"
    },
    "author": "",
    "license": "ISC",
    "devDependencies": {
    "c8": "~7.7.2",
    "nodemon": "~2.0.7",
    "ts-node": "~9.1.1",
    "zora": "^4.1.0"
    }
    }
    6 changes: 6 additions & 0 deletions sum.spec.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    import {test} from 'zora';
    import sum from './sum'

    test(`sum`, (t) =>{
    t.eq(sum(0,4), 4);
    })
    5 changes: 5 additions & 0 deletions sum.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    import {foo} from './to-be-excluded';

    foo();

    export default (a: number, b: number): number => a + b;
    3 changes: 3 additions & 0 deletions to-be-excluded.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    export const foo = () => {
    console.log(foo);
    }