Skip to content

Commit

Permalink
fix: use plain ES5
Browse files Browse the repository at this point in the history
  • Loading branch information
boennemann committed Nov 27, 2015
1 parent 0c20e94 commit 481d4cb
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 63 deletions.
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,3 @@ node_modules
*.log
.DS_Store
.nyc_output
.test
.tmp

# build-artifacts
dist
4 changes: 0 additions & 4 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ node_modules
*.log
.DS_Store
.nyc_output
.test
.tmp

# source/config
src
test
*.yml
.gitignore
24 changes: 4 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,9 @@
"bugs": {
"url": "https://github.com/semantic-release/error/issues"
},
"config": {
"nyc": {
"exclude": [
".test",
"node_modules"
]
}
},
"devDependencies": {
"babel": "5.8.23",
"coveralls": "2.11.4",
"mkdirp": "0.5.1",
"nyc": "3.2.2",
"rimraf": "2.4.3",
"semantic-release": "4.3.5",
"standard": "5.4.1",
"tap": "2.2.0"
Expand All @@ -29,21 +18,16 @@
"semantic-release"
],
"license": "MIT",
"main": "dist/index.js",
"main": "src/index.js",
"repository": {
"type": "git",
"url": "https://github.com/semantic-release/error.git"
},
"scripts": {
"build": "rimraf dist && mkdirp dist && babel src --out-dir dist",
"build:tests": "rimraf .test && mkdirp .test && babel test --out-dir .test",
"coverage": "nyc report",
"coverage:upload": "npm run coverage -- --reporter=lcovonly && coveralls < coverage/lcov.info",
"prepublish": "npm run build",
"pretest:suite": "npm run build && npm run build:tests",
"coverage:upload": "npm run -s coverage -- --reporter=text-lcov | coveralls",
"pretest": "standard",
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
"test": "npm run test:style && npm run test:suite",
"test:style": "standard",
"test:suite": "nyc tap --no-cov .test/{scenarios,specs}/*.js"
"test": "nyc tap --no-cov test/*.js"
}
}
14 changes: 8 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
module.exports = class SemanticReleaseError extends Error {
constructor (message, code) {
super()
this.message = message
this.code = code
}
module.exports = SemanticReleaseError

SemanticReleaseError.prototype = new Error()
function SemanticReleaseError (message, code) {
Error.captureStackTrace(this, this.constructor)
this.name = this.constructor.name
this.message = message
this.code = code
}
28 changes: 28 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
var test = require('tap').test

var SemanticReleaseError = require('../')

test('instanciates error', function (t) {
var error = new SemanticReleaseError()

t.ok(error instanceof Error)
t.end()
})

test('sets message', function (t) {
var message = 'foo'
var error = new SemanticReleaseError(message)

t.is(error.message, message)
t.end()
})

test('sets message and code', function (t) {
var code = 'ENOFOO'
var message = 'bar'
var error = new SemanticReleaseError(message, code)

t.is(error.code, code)
t.is(error.message, message)
t.end()
})
28 changes: 0 additions & 28 deletions test/specs/index.js

This file was deleted.

0 comments on commit 481d4cb

Please # to comment.