Skip to content

Commit

Permalink
include a minimalistic nodejs lib
Browse files Browse the repository at this point in the history
  • Loading branch information
FenrirUnbound committed Dec 1, 2016
1 parent 7bad4fc commit 7a253ea
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 1 deletion.
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,31 @@
# quickstart-nodejs
# quickstart-nodejs

Node.js sample application for Screwdriver

## Pipeline

### Fail to Publish

The `publish` job is properly defined in the `screwdriver.yaml`. The package is purposely configured to fail.

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.

## Dev

### Requirements

* [NodeJS](https://nodejs.org/en/)
* NPM (included in the NodeJS package)

### Install dependencies

```
$ npm install
```

### Run tests

```
$ npm test
```

5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

module.exports = () => {
return 'Hello Node';
};
33 changes: 33 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "screwdriver-quickstart-nodejs",
"version": "1.0.0",
"description": "A quickstart repository, which serves as an example of how to use Screwdriver with NodeJS",
"main": "index.js",
"scripts": {
"test": "mocha"
},
"repository": {
"type": "git",
"url": "git+https://github.com/screwdriver-cd-test/quickstart-nodejs.git"
},
"keywords": [
"screwdriver",
"screwdriver-cd",
"yahoo",
"continuous delivery",
"cd",
"continuous integration",
"ci"
],
"author": "Darren Matsumoto <[email protected]>",
"license": "BSD-3-Clause",
"bugs": {
"url": "https://github.com/screwdriver-cd-test/quickstart-nodejs/issues"
},
"homepage": "https://github.com/screwdriver-cd-test/quickstart-nodejs#readme",
"private": true,
"devDependencies": {
"chai": "^3.5.0",
"mocha": "^3.2.0"
}
}
12 changes: 12 additions & 0 deletions test/index.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use strict';

const expect = require('chai').expect;

describe('Index Unit Test', () => {
it('works', () => {
const main = require('../');
const result = main();

expect(result).to.equal('Hello Node');
});
});

0 comments on commit 7a253ea

Please sign in to comment.