-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lint major changes and plugin tests pass with
npm test
- Loading branch information
Showing
17 changed files
with
695 additions
and
711 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"extends": "airbnb-base", | ||
"rules": { | ||
"max-len": [2, 150, 4] | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,80 +1,77 @@ | ||
'use strict'; | ||
const test = require('tape'); | ||
const tape = require('tape-catch'); | ||
|
||
test('Real relative file exists', (assert) => { | ||
const module = require('../lib'); | ||
const testPath = './plugins/exists/test/fixtures/exists.txt'; | ||
tape('Index', { skip: false }, (describe) => { | ||
const path = require('path'); | ||
|
||
module.pathExists(testPath) | ||
.then(() => { | ||
assert.pass('Resolved promise is returned'); | ||
assert.end(); | ||
}) | ||
.catch(() => { | ||
assert.fail(`File system is missing folder (${testPath})`); | ||
assert.end(); | ||
}); | ||
}); | ||
const lib = require('../lib'); | ||
|
||
test('Real relative folder exists', (assert) => { | ||
const module = require('../lib'); | ||
const testPath = './plugins/exists/test/fixtures'; | ||
describe.test('* Real relative file exists', (assert) => { | ||
const testPath = './plugins/exists/test/fixtures/exists.txt'; | ||
|
||
module.pathExists(testPath) | ||
.then(() => { | ||
assert.pass('Resolved promise is returned'); | ||
assert.end(); | ||
}) | ||
.catch(() => { | ||
assert.fail(`File system is missing folder (${testPath})`); | ||
assert.end(); | ||
}); | ||
}); | ||
lib.pathExists(testPath) | ||
.then(() => { | ||
assert.pass('Resolved promise is returned'); | ||
assert.end(); | ||
}) | ||
.catch((error) => { | ||
assert.fail(error); | ||
assert.end(); | ||
}); | ||
}); | ||
|
||
test('Real absolute file exists', (assert) => { | ||
const module = require('../lib'); | ||
const path = require('path'); | ||
const testPath = path.join(__dirname, './fixtures/exists.txt'); | ||
describe.test('* Real relative folder exists', (assert) => { | ||
const testPath = './plugins/exists/test/fixtures'; | ||
|
||
module.pathExists(testPath) | ||
.then((verifiedPath) => { | ||
assert.equal(verifiedPath, testPath, 'Resolved path matches'); | ||
assert.end(); | ||
}) | ||
.catch(() => { | ||
assert.fail(`File system is missing folder (${testPath})`); | ||
assert.end(); | ||
}); | ||
}); | ||
lib.pathExists(testPath) | ||
.then(() => { | ||
assert.pass('Resolved promise is returned'); | ||
assert.end(); | ||
}) | ||
.catch((error) => { | ||
assert.fail(error); | ||
assert.end(); | ||
}); | ||
}); | ||
|
||
test('Real absolute folder exists', (assert) => { | ||
const module = require('../lib'); | ||
const path = require('path'); | ||
const testPath = path.join(__dirname, './fixtures'); | ||
describe.test('* Real absolute file exists', (assert) => { | ||
const testPath = path.join(__dirname, './fixtures/exists.txt'); | ||
|
||
module.pathExists(testPath) | ||
.then((verifiedPath) => { | ||
assert.equal(verifiedPath, testPath, 'Resolved path matches'); | ||
assert.end(); | ||
}) | ||
.catch(() => { | ||
assert.fail(`File system is missing folder (${testPath})`); | ||
assert.end(); | ||
}); | ||
}); | ||
lib.pathExists(testPath) | ||
.then((verifiedPath) => { | ||
assert.equal(verifiedPath, testPath, 'Resolved path matches'); | ||
assert.end(); | ||
}) | ||
.catch((error) => { | ||
assert.fail(error); | ||
assert.end(); | ||
}); | ||
}); | ||
|
||
test('Fake absolute path does not exists', (assert) => { | ||
const module = require('../lib'); | ||
const path = require('path'); | ||
const testPath = path.join(__dirname, './fixtures/fakeFolder'); | ||
describe.test('* Real absolute folder exists', (assert) => { | ||
const testPath = path.join(__dirname, './fixtures'); | ||
|
||
lib.pathExists(testPath) | ||
.then((verifiedPath) => { | ||
assert.equal(verifiedPath, testPath, 'Resolved path matches'); | ||
assert.end(); | ||
}) | ||
.catch((error) => { | ||
assert.fail(error); | ||
assert.end(); | ||
}); | ||
}); | ||
|
||
describe.test('* Fake absolute path does not exists', (assert) => { | ||
const testPath = path.join(__dirname, './fixtures/fakeFolder'); | ||
|
||
module.pathExists(testPath) | ||
.then(() => { | ||
assert.fail(`File system found a fake folder (${testPath})`); | ||
assert.end(); | ||
}) | ||
.catch((error) => { | ||
assert.equal(error.isBoom, true, 'Rejected promise is a boom error'); | ||
assert.end(); | ||
}); | ||
lib.pathExists(testPath) | ||
.then(() => { | ||
assert.fail(`File system found a fake folder (${testPath})`); | ||
assert.end(); | ||
}) | ||
.catch((error) => { | ||
assert.equal(error.isBoom, true, 'Rejected promise is a boom error'); | ||
assert.end(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"name": "history-plugins", | ||
"version": "1.1.10", | ||
"description": "Developer dependencies for history plugins", | ||
"main": "gulpfile.js", | ||
"scripts": { | ||
"dev": "gulp", | ||
"lint": "gulp lint", | ||
"test": "gulp test" | ||
}, | ||
"dependencies": { | ||
"app-root-path": "^2.0.1", | ||
"async": "^2.1.2", | ||
"boom": "^4.0.0", | ||
"glob": "^7.0.0", | ||
"joi": "^9.1.1" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^3.4.0", | ||
"eslint-config-airbnb-base": "^8.0.0", | ||
"eslint-plugin-import": "^1.8.0", | ||
"gulp": "^3.9.0", | ||
"gulp-eslint": "^3.0.1", | ||
"gulp-expect-file": "0.0.7", | ||
"gulp-print": "^2.0.1", | ||
"gulp-tape": "0.0.7", | ||
"hapi": "^15.0.3", | ||
"tape": "4.6.0", | ||
"tape-catch": "^1.0.6" | ||
}, | ||
"author": { | ||
"name": "danactive", | ||
"url": "http://twitter.com/danactive" | ||
}, | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/danactive/history.git" | ||
}, | ||
"engines": { | ||
"npm": ">3", | ||
"node": ">4" | ||
} | ||
} |
Oops, something went wrong.