Skip to content

Commit 7a253ea

Browse files
committed
include a minimalistic nodejs lib
1 parent 7bad4fc commit 7a253ea

File tree

4 files changed

+81
-1
lines changed

4 files changed

+81
-1
lines changed

README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,31 @@
1-
# quickstart-nodejs
1+
# quickstart-nodejs
2+
3+
Node.js sample application for Screwdriver
4+
5+
## Pipeline
6+
7+
### Fail to Publish
8+
9+
The `publish` job is properly defined in the `screwdriver.yaml`. The package is purposely configured to fail.
10+
11+
Given that this package is basic, we don't want to flood the NPM Registry with quickstart modules. The included `package.json` file contains a `private: true` flag to safeguard against publishing to the NPM Registry.
12+
13+
## Dev
14+
15+
### Requirements
16+
17+
* [NodeJS](https://nodejs.org/en/)
18+
* NPM (included in the NodeJS package)
19+
20+
### Install dependencies
21+
22+
```
23+
$ npm install
24+
```
25+
26+
### Run tests
27+
28+
```
29+
$ npm test
30+
```
31+

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+
module.exports = () => {
4+
return 'Hello Node';
5+
};

package.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "screwdriver-quickstart-nodejs",
3+
"version": "1.0.0",
4+
"description": "A quickstart repository, which serves as an example of how to use Screwdriver with NodeJS",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "mocha"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/screwdriver-cd-test/quickstart-nodejs.git"
12+
},
13+
"keywords": [
14+
"screwdriver",
15+
"screwdriver-cd",
16+
"yahoo",
17+
"continuous delivery",
18+
"cd",
19+
"continuous integration",
20+
"ci"
21+
],
22+
"author": "Darren Matsumoto <[email protected]>",
23+
"license": "BSD-3-Clause",
24+
"bugs": {
25+
"url": "https://github.com/screwdriver-cd-test/quickstart-nodejs/issues"
26+
},
27+
"homepage": "https://github.com/screwdriver-cd-test/quickstart-nodejs#readme",
28+
"private": true,
29+
"devDependencies": {
30+
"chai": "^3.5.0",
31+
"mocha": "^3.2.0"
32+
}
33+
}

test/index.test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
'use strict';
2+
3+
const expect = require('chai').expect;
4+
5+
describe('Index Unit Test', () => {
6+
it('works', () => {
7+
const main = require('../');
8+
const result = main();
9+
10+
expect(result).to.equal('Hello Node');
11+
});
12+
});

0 commit comments

Comments
 (0)