Skip to content

Commit

Permalink
create npm package and add index.js and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
christophervoigt committed Dec 23, 2018
1 parent e4997d2 commit d2a01b9
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "airbnb-base",
"rules": {
"no-use-before-define": [
"error", {
"functions": false
}
],
"linebreak-style": 0
},
"env": {
"browser": true
}
}
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
7 changes: 7 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@


function jeffsum(number, textType) {
return 'hello';
}

module.exports = jeffsum;
34 changes: 34 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "jeffsum",
"version": "0.0.1",
"description": "Jeff Goldblum text placeholder generator of pure amazingness.",
"license": "MIT",
"author": "Christopher Voigt <[email protected]>",
"homepage": "http://jeffsum.com/",
"main": "index.js",
"scripts": {
"lint": "eslint --quiet index.js test/**/*.js",
"test": "mocha"
},
"repository": {
"type": "git",
"url": "git+https://github.com/chlorophyllkid/jeffsum.git"
},
"bugs": {
"url": "https://github.com/chlorophyllkid/jeffsum/issues"
},
"keywords": [
"jeff",
"goldblum",
"lorem",
"ipsum",
"generator"
],
"devDependencies": {
"chai": "^4.2.0",
"eslint": "^5.11.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-plugin-import": "^2.14.0",
"mocha": "^5.2.0"
}
}
12 changes: 12 additions & 0 deletions test/jeffsum.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* global describe, it */

const { assert } = require('chai');

const jeffsum = require('../index.js');

describe('jeffsum', () => {
it('should return 5 characters on jeffsum(5, "characters")', () => {
const text = jeffsum(5, 'characters');
assert.lengthOf(text, 5);
});
});

0 comments on commit d2a01b9

Please sign in to comment.