Skip to content

Instantly share code, notes, and snippets.

@yoursunny
Last active October 22, 2019 04:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yoursunny/4e1b64118e402164a7d4841ee205a513 to your computer and use it in GitHub Desktop.
Save yoursunny/4e1b64118e402164a7d4841ee205a513 to your computer and use it in GitHub Desktop.
.nyc_output
coverage
node_modules
package-lock.json
export class Main {
public x: number;
constructor() {
this.x = 1;
}
}
export namespace Main {
export function f() {
return 2;
}
}
{
"private": true,
"scripts": {
"test": "nyc mocha -r ts-node/register test.ts"
},
"nyc": {
"extension": [
".ts"
],
"exclude": [
"test.ts"
]
},
"devDependencies": {
"@types/chai": "^4.2.3",
"@types/mocha": "^5.2.7",
"chai": "^4.2.0",
"mocha": "^6.2.2",
"nyc": "^14.1.1",
"source-map-support": "^0.5.13",
"ts-node": "^8.4.1",
"typescript": "^3.6.4"
}
}
import { expect } from "chai";
import { Main } from "./main";
describe("Main type", () => {
it("is a class", () => {
const m = new Main();
expect(m.x).eq(1);
});
it("has a function", () => {
const v = Main.f();
expect(v).eq(2);
});
});
{
"compilerOptions": {
"emitDecoratorMetadata": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"module": "commonjs",
"noImplicitAny": false,
"noImplicitReturns": true,
"noUnusedLocals": true,
"sourceMap": true,
"strict": true,
"target": "es2019",
"types": [
"mocha"
]
},
"include": [
"*.ts"
],
"exclude": [
"**/node_modules"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment