Skip to content

Commit 6f272d6

Browse files
committed
initial
0 parents  commit 6f272d6

File tree

7 files changed

+196
-0
lines changed

7 files changed

+196
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
.DS_Store
3+
npm-debug.log

.npmrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
registry=http://registry.npmjs.org/
2+
save-exact=true
3+
progress=false
4+

.travis.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
language: node_js
2+
cache:
3+
directories:
4+
- node_modules
5+
notifications:
6+
email: false
7+
node_js:
8+
- '7'
9+
- '6'
10+
- '4'
11+
before_script:
12+
- npm prune
13+
after_success:
14+
- npm run semantic-release
15+
branches:
16+
except:
17+
- /^v\d+\.\d+\.\d+$/

README.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# stub-spawn-once
2+
3+
> Stubs child_process.spawn for a single command; cleans up afterwards. Perfect for testing.
4+
5+
[![NPM][npm-icon] ][npm-url]
6+
7+
[![Build status][ci-image] ][ci-url]
8+
[![semantic-release][semantic-image] ][semantic-url]
9+
[![js-standard-style][standard-image]][standard-url]
10+
11+
## Install
12+
13+
Requires [Node](https://nodejs.org/en/) version 6 or above.
14+
15+
```sh
16+
npm install --save stub-spawn-once
17+
```
18+
19+
## Use
20+
21+
### Small print
22+
23+
Author: Gleb Bahmutov <[email protected]> © 2017
24+
25+
* [@bahmutov](https://twitter.com/bahmutov)
26+
* [glebbahmutov.com](https://glebbahmutov.com)
27+
* [blog](https://glebbahmutov.com/blog)
28+
29+
License: MIT - do anything with the code, but don't blame me if it does not work.
30+
31+
Support: if you find any problems with this module, email / tweet /
32+
[open issue](https://github.com/bahmutov/stub-spawn-once/issues) on Github
33+
34+
## MIT License
35+
36+
Copyright (c) 2017 Gleb Bahmutov <[email protected]>
37+
38+
Permission is hereby granted, free of charge, to any person
39+
obtaining a copy of this software and associated documentation
40+
files (the "Software"), to deal in the Software without
41+
restriction, including without limitation the rights to use,
42+
copy, modify, merge, publish, distribute, sublicense, and/or sell
43+
copies of the Software, and to permit persons to whom the
44+
Software is furnished to do so, subject to the following
45+
conditions:
46+
47+
The above copyright notice and this permission notice shall be
48+
included in all copies or substantial portions of the Software.
49+
50+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
51+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
52+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
53+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
54+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
55+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
56+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
57+
OTHER DEALINGS IN THE SOFTWARE.
58+
59+
[npm-icon]: https://nodei.co/npm/stub-spawn-once.svg?downloads=true
60+
[npm-url]: https://npmjs.org/package/stub-spawn-once
61+
[ci-image]: https://travis-ci.org/bahmutov/stub-spawn-once.svg?branch=master
62+
[ci-url]: https://travis-ci.org/bahmutov/stub-spawn-once
63+
[semantic-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
64+
[semantic-url]: https://github.com/semantic-release/semantic-release
65+
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg
66+
[standard-url]: http://standardjs.com/

package.json

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"name": "stub-spawn-once",
3+
"description": "Stubs child_process.spawn for a single command; cleans up afterwards. Perfect for testing.",
4+
"version": "0.0.0-development",
5+
"author": "Gleb Bahmutov <[email protected]>",
6+
"bugs": "https://github.com/bahmutov/stub-spawn-once/issues",
7+
"config": {
8+
"pre-git": {
9+
"commit-msg": "simple",
10+
"pre-commit": [
11+
"npm prune",
12+
"npm run deps",
13+
"npm test",
14+
"git add src/*.js",
15+
"npm run ban"
16+
],
17+
"pre-push": [
18+
"npm run secure",
19+
"npm run license",
20+
"npm run ban -- --all",
21+
"npm run size"
22+
],
23+
"post-commit": [],
24+
"post-merge": []
25+
}
26+
},
27+
"engines": {
28+
"node": ">=6"
29+
},
30+
"files": [
31+
"src/*.js",
32+
"!src/*-spec.js"
33+
],
34+
"homepage": "https://github.com/bahmutov/stub-spawn-once#readme",
35+
"keywords": [
36+
"exec",
37+
"mock",
38+
"spawn",
39+
"stub",
40+
"test",
41+
"testing"
42+
],
43+
"license": "MIT",
44+
"main": "src/",
45+
"publishConfig": {
46+
"registry": "http://registry.npmjs.org/"
47+
},
48+
"repository": {
49+
"type": "git",
50+
"url": "https://github.com/bahmutov/stub-spawn-once.git"
51+
},
52+
"scripts": {
53+
"ban": "ban",
54+
"deps": "deps-ok && dependency-check --no-dev .",
55+
"issues": "git-issues",
56+
"license": "license-checker --production --onlyunknown --csv",
57+
"lint": "standard --verbose --fix src/*.js",
58+
"prelint": "npm run pretty",
59+
"pretest": "npm run lint",
60+
"pretty": "prettier-standard 'src/*.js'",
61+
"secure": "nsp check",
62+
"size": "t=\"$(npm pack .)\"; wc -c \"${t}\"; tar tvf \"${t}\"; rm \"${t}\";",
63+
"test": "npm run unit",
64+
"unit": "mocha src/*-spec.js",
65+
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
66+
},
67+
"devDependencies": {
68+
"ban-sensitive-files": "1.9.0",
69+
"dependency-check": "2.9.1",
70+
"deps-ok": "1.2.0",
71+
"dont-crack": "1.2.1",
72+
"git-issues": "1.3.1",
73+
"github-post-release": "1.7.1",
74+
"license-checker": "12.0.0",
75+
"mocha": "3.4.2",
76+
"nsp": "2.6.3",
77+
"pre-git": "3.15.0",
78+
"semantic-release": "6.3.6",
79+
"simple-commit-message": "3.1.0",
80+
"standard": "10.0.2"
81+
},
82+
"release": {
83+
"analyzeCommits": "simple-commit-message",
84+
"generateNotes": "github-post-release",
85+
"verifyRelease": {
86+
"path": "dont-crack",
87+
"test-against": []
88+
}
89+
}
90+
}

src/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
'use strict'
2+
3+
4+
module.exports = true
5+

src/stub-spawn-once-spec.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'use strict'
2+
3+
4+
/* global describe, it */
5+
const stubSpawnOnce = require('.')
6+
7+
describe('stub-spawn-once', () => {
8+
it('write this test', () => {
9+
console.assert(stubSpawnOnce, 'should export something')
10+
})
11+
})

0 commit comments

Comments
 (0)