Skip to content

Commit

Permalink
Updates tests. Updates engines
Browse files Browse the repository at this point in the history
  • Loading branch information
zrrrzzt committed Nov 12, 2017
1 parent 68d47d6 commit a1745eb
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 14 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "micro-stats",
"description": "Stats",
"version": "1.2.0",
"version": "1.2.1",
"license": "MIT",
"private": true,
"author": {
Expand All @@ -11,7 +11,7 @@
},
"main": "index.js",
"engines": {
"node": ">=8.7.0"
"node": ">=8.9.1"
},
"scripts": {
"test": "standard && nsp check && ava",
Expand All @@ -36,7 +36,7 @@
"bugs": {
"url": "https://github.com/telemark/stats/issues"
},
"homepage": "https://github.com/telemark/stats",
"homepage": "https://github.com/telemark/stats#readme",
"now": {
"alias": [
"stats.service.t-fk.no"
Expand Down
18 changes: 13 additions & 5 deletions test/modules/dependencies-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@
const test = require('ava')
const pkg = require('../../package.json')
const dependencies = pkg.dependencies || {}
const dropModules = []
const isDropped = (module) => !dropModules.includes(module)

Object.keys(dependencies).forEach((dependency) => {
test(`${dependency} loads ok`, t => {
const module = require(dependency)
t.truthy(module)
if (Object.keys(dependencies).length > 0) {
Object.keys(dependencies).filter(isDropped).forEach((dependency) => {
test(`${dependency} loads ok`, t => {
const module = require(dependency)
t.truthy(module)
})
})
})
} else {
test('no dependecies to test', t => {
t.truthy(true)
})
}
18 changes: 12 additions & 6 deletions test/modules/dev-dependencies-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@
const test = require('ava')
const pkg = require('../../package.json')
const dependencies = pkg.devDependencies || {}
const dropModules = ['micro-dev']
const dropModules = ['micro-dev', 'nsp']
const isDropped = (module) => !dropModules.includes(module)

Object.keys(dependencies).filter(isDropped).forEach((dependency) => {
test(`${dependency} loads ok`, t => {
const module = require(dependency)
t.truthy(module)
if (Object.keys(dependencies).length > 0) {
Object.keys(dependencies).filter(isDropped).forEach((dependency) => {
test(`${dependency} loads ok`, t => {
const module = require(dependency)
t.truthy(module)
})
})
})
} else {
test('no dependecies to test', t => {
t.truthy(true)
})
}

0 comments on commit a1745eb

Please sign in to comment.