Skip to content

Commit 0cfe25a

Browse files
author
David Chase
committed
feat(TESTS) add npm + tests
1 parent d8fe564 commit 0cfe25a

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

package.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "path-union",
3+
"version": "1.0.0",
4+
"description": "Create a union between two paths",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "tape test.js | tap-spec"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/davidchase/path-union.git"
12+
},
13+
"keywords": [
14+
"path",
15+
"union",
16+
"functional"
17+
],
18+
"author": "David Chase <[email protected]>",
19+
"license": "MIT",
20+
"bugs": {
21+
"url": "https://github.com/davidchase/path-union/issues"
22+
},
23+
"homepage": "https://github.com/davidchase/path-union#readme",
24+
"devDependencies": {
25+
"tap-spec": "4.1.1",
26+
"tape": "4.6.0"
27+
}
28+
}

test.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
'use strict'
2+
3+
const test = require('tape')
4+
const path = require('path')
5+
const union = require('./index')
6+
7+
8+
test('it works', function(t){
9+
const expected = path.join(__dirname, 'output/src/images/')
10+
const expected2 = path.join(__dirname, 'output/images/src/stuff/')
11+
12+
t.equal(union(path.join(__dirname, 'output'), path.join(__dirname, 'src/images')), expected)
13+
t.equal(union(path.join(__dirname, 'output/images'), path.join(__dirname, 'src/stuff')), expected2)
14+
t.end()
15+
})
16+

0 commit comments

Comments
 (0)