Skip to content

Commit

Permalink
Fixed coverage by downgrading Jest? Swapped for codecov?
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmay committed Jul 16, 2018
1 parent f5a1d67 commit 9c284b5
Show file tree
Hide file tree
Showing 10 changed files with 434 additions and 520 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}

# run tests!
# - run: yarn test
- run: yarn test:ci
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# IO-Guard [![CircleCI](https://circleci.com/gh/seanmay/io-guard/tree/master.svg?style=svg)](https://circleci.com/gh/seanmay/io-guard/tree/master) [![CodeFactor](https://www.codefactor.io/repository/github/seanmay/io-guard/badge)](https://www.codefactor.io/repository/github/seanmay/io-guard)
# IO-Guard
[![CircleCI](https://circleci.com/gh/seanmay/io-guard/tree/master.svg?style=svg)](https://circleci.com/gh/seanmay/io-guard/tree/master) [![CodeFactor](https://www.codefactor.io/repository/github/seanmay/io-guard/badge)](https://www.codefactor.io/repository/github/seanmay/io-guard) [![codecov](https://codecov.io/gh/seanmay/io-guard/branch/master/graph/badge.svg)](https://codecov.io/gh/seanmay/io-guard)

A simple object validator which also supports TypeScript type guards, for the purpose of runtime and compile-time validation of foreign data.

Expand Down
33 changes: 24 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,47 @@
"bugs": {
"url": "https://github.com/seanmay/io-guard/issues"
},
"homepage": "https://github.com/seanmay/io-guard",
"scripts": {
"test": "jest",
"test:ci": "jest --coverage --coverageReporters=text-lcov | coveralls",
"test:ci": "jest --coverage --ci --runInBand && codecov",
"build": "tsc --strict --outDir dist -d --inlineSourceMap true --inlineSources --module es2015 src/index.ts && rollup -c"
},
"devDependencies": {
"@types/jest": "^23.1.4",
"@babel/core": "^7.0.0-beta.53",
"@types/jest": "22",
"babel-core": "^7.0.0-beta.3",
"coveralls": "^3.0.2",
"jest": "^23.3.0",
"codecov": "^3.0.4",
"jest": "22",
"rollup": "^0.62.0",
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-typescript": "^1.1.2",
"ts-jest": "^23.0.0",
"ts-jest": "22",
"typescript": "^2.9.2"
},
"jest": {
"transform": {
".(ts|tsx)": "<rootDir>/node_modules/ts-jest/preprocessor.js"
},
"testRegex": "\\.test\\.(ts|tsx)$",
"testRegex": "\\.test\\.tsx?$",
"moduleFileExtensions": [
"ts",
"tsx",
"js"
"js",
"jsx"
],
"collectCoverage": true
}
"collectCoverageFrom": [
"src/**/*.ts"
],
"coverageDirectory": "./coverage",
"coverageThreshold": {
"global": {
"branches": 90,
"functions": 90,
"lines": 90,
"statements": 90
}
}
},
"dependencies": {}
}
6 changes: 3 additions & 3 deletions src/guards.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Guard, GuardEach } from "./index";
import { and } from "./operators/index";
import { isString, isNumber } from "./guards/index";
import { and } from "./operators/operators";
import { isString } from "./guards/guards";

describe("Guard", () => {
it("takes an object of keys and validators, validates input with the same keys, and passes if every validator passes (short-ciruit on fail)", () => {
Expand Down Expand Up @@ -40,9 +40,9 @@ describe("Guard", () => {
}
};

// @ts-ignore
const dent: User = {
name: "Arthur Dent",
//@ts-ignore
address: null
};

Expand Down
11 changes: 0 additions & 11 deletions src/guards/index.ts

This file was deleted.

4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ const GuardEach = <T>(

export { Guard, GuardEach };

export { isNumber, isString, isBoolean, isArray } from "./guards/index";
export { compose, and, or, optional, nullable, erratic } from "./operators/index";
export { isNumber, isString, isBoolean, isArray } from "./guards/guards";
export { compose, and, or, optional, nullable, erratic } from "./operators/operators";
2 changes: 1 addition & 1 deletion src/operators.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
compose,
customTest,
unsafeTest
} from "./operators/index";
} from "./operators/operators";

describe("[Operators] optional", () => {
it("runs the test function, if given a value", () => {
Expand Down
32 changes: 0 additions & 32 deletions src/operators/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/typeguards.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
isTypeof,
isArray
} from "./guards/index";
} from "./guards/guards";

describe("[Guards] isTypeof", () => {
it("Provides a TypeGuard for a type, given input value, based on `typeof` checks", () => {
Expand Down
Loading

0 comments on commit 9c284b5

Please sign in to comment.