Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Commit

Permalink
Internal: Stop using nyc --all for accurate reporting
Browse files Browse the repository at this point in the history
Use empty test files instead. See istanbuljs/nyc#181

Closes #247
  • Loading branch information
MoOx committed Mar 5, 2016
1 parent 291e2c2 commit 6a31ed5
Show file tree
Hide file tree
Showing 11 changed files with 86 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
"pretest": "npm run lint",
"test": "npm run tests && npm run test-boilerplate",
"posttest": "npm run docs",
"test-with-coverage": "nyc --all --require babel-core/register npm run tests && npm run test-boilerplate",
"test-with-coverage": "nyc npm run tests && npm run test-boilerplate",
"posttest-with-coverage": "npm run docs ",
"coverage": "nyc report --reporter=lcovonly && codecov",
"release": "npmpub"
Expand Down
8 changes: 8 additions & 0 deletions src/Link/__tests__/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import test from "ava"

// files added to report accurate coverage
import "../index.js"

test("todo", () => {
console.log("TODO: test src/Link/*")
})
8 changes: 8 additions & 0 deletions src/PageContainer/__tests__/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import test from "ava"

// files added to report accurate coverage
import "../index.js"

test("todo", () => {
console.log("TODO: test src/PageContainer/index*")
})
8 changes: 8 additions & 0 deletions src/_utils/catch-links/__tests__/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import test from "ava"

// files added to report accurate coverage
import "../index.js"

test("todo", () => {
console.log("TODO: test src/utils/catch-links/*")
})
14 changes: 14 additions & 0 deletions src/bin/__tests__/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import test from "ava"

// files added to report accurate coverage
import "../data/questions.js"
import "../data/template.js"
import "../utils/inquirer.js"
// we need to explode those files into function and just call functions
// in the bins
// import "./index.js"
// import "./statinamic-setup.js"

test("todo", () => {
console.log("TODO: test src/bin/*")
})
9 changes: 9 additions & 0 deletions src/builder/__tests__/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import test from "ava"

// files added to report accurate coverage
import "../index.js"
import "../webpack.js"

test("todo", () => {
console.log("TODO: test src/builder/*")
})
8 changes: 8 additions & 0 deletions src/client/__tests__/DevTools.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import test from "ava"

// files added to report accurate coverage
import "../DevTools.js"

test("todo", () => {
console.log("TODO: test src/client/DevTools*")
})
8 changes: 8 additions & 0 deletions src/client/__tests__/hot-md.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import test from "ava"

// files added to report accurate coverage
import "../hot-md.js"

test("todo", () => {
console.log("TODO: test src/client/hot-md")
})
8 changes: 8 additions & 0 deletions src/client/__tests__/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import test from "ava"

// files added to report accurate coverage
import "../index.js"

test("todo", () => {
console.log("TODO: test src/client/index")
})
9 changes: 6 additions & 3 deletions src/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ import { Provider as ReduxContextProvider } from "react-redux"

import StatinamicContextProvider from "../ContextProvider"

export const browserHistory = useRouterHistory(createBrowserHistory)({
basename: process.env.STATINAMIC_PATHNAME,
})
export const browserHistory =
typeof window !== "undefined" // just for node testing
? useRouterHistory(createBrowserHistory)({
basename: process.env.STATINAMIC_PATHNAME,
})
: null

export default function statinamic({
layouts,
Expand Down
8 changes: 8 additions & 0 deletions src/static/__tests__/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import test from "ava"

// files added to report accurate coverage
import "../index.js"

test("todo", () => {
console.log("TODO: test src/static/index*")
})

0 comments on commit 6a31ed5

Please sign in to comment.