diff --git a/.package.json.swp b/.package.json.swp deleted file mode 100644 index 5ca04c7..0000000 Binary files a/.package.json.swp and /dev/null differ diff --git a/appveyor.yml b/appveyor.yml index 63dab9f..077b8da 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,7 +15,7 @@ install: test_script: - node --version - npm --version - - npm run test:win + - npm run test build: off clone_depth: 1 diff --git a/package.json b/package.json index 1544fef..3fc6b7f 100644 --- a/package.json +++ b/package.json @@ -7,13 +7,14 @@ "example": "examples" }, "scripts": { - "test": "npm run lint && node test/youch.spec.js", + "test": "npm run lint && _mocha test/*.spec.js", "lint": "standard src/Youch" }, "author": "amanvirk", "license": "MIT", "devDependencies": { - "japa": "^1.0.0", + "chai": "^3.5.0", + "mocha": "^3.2.0", "standard": "^8.6.0", "supertest": "^3.0.0" }, diff --git a/test/.youch.spec.js.swp b/test/.youch.spec.js.swp deleted file mode 100644 index 4317355..0000000 Binary files a/test/.youch.spec.js.swp and /dev/null differ diff --git a/test/youch.spec.js b/test/youch.spec.js index dae0bfa..6e535de 100644 --- a/test/youch.spec.js +++ b/test/youch.spec.js @@ -2,22 +2,21 @@ const http = require('http') const supertest = require('supertest') -const test = require('japa') const Youch = require('../src/Youch') +const assert = require('chai').assert const DEFAULT_PORT=8000 -test.group('Youch', () => { +describe('Youch', () => { - test('initiate a new instance by passing error object', (assert) => { + it('initiate a new instance by passing error object', () => { const error = new Error('foo') const youch = new Youch(error, {}) assert.equal(youch.error.message, 'foo') assert.deepEqual(youch.request, {}) }) - test('parse the error into frames', (assert, done) => { - assert.plan(2) + it('parse the error into frames', (done) => { const error = new Error('foo') const youch = new Youch(error, {}) youch @@ -29,7 +28,7 @@ test.group('Youch', () => { }).catch(done) }) - test('parse stack frame context to tokens', (assert, done) => { + it('parse stack frame context to tokens', (done) => { const error = new Error('this is bar') const youch = new Youch(error, {}) @@ -43,7 +42,7 @@ test.group('Youch', () => { .catch(done) }) - test('return active class when index is 0', (assert) => { + it('return active class when index is 0', () => { const error = new Error('this is bar') const youch = new Youch(error, {}) const frame = { @@ -55,7 +54,7 @@ test.group('Youch', () => { assert.equal(classes, 'active') }) - test('return native frame class when frame is native', (assert) => { + it('return native frame class when frame is native', () => { const error = new Error('this is bar') const youch = new Youch(error, {}) const frame = { @@ -67,7 +66,7 @@ test.group('Youch', () => { assert.equal(classes, 'active native-frame') }) - test('return native frame class when frame is from node_modules', (assert) => { + it('return native frame class when frame is from node_modules', () => { const error = new Error('this is bar') const youch = new Youch(error, {}) const frame = { @@ -79,7 +78,7 @@ test.group('Youch', () => { assert.equal(classes, 'active native-frame') }) - test('serialize http request', (assert, done) => { + it('serialize http request', (done) => { const server = http.createServer((req, res) => { const youch = new Youch({}, req) res.writeHead(200, {'content-type': 'application/json'}) @@ -102,7 +101,7 @@ test.group('Youch', () => { }) }) - test('serialize http request and return cookies from it', (assert, done) => { + it('serialize http request and return cookies from it', (done) => { const server = http.createServer((req, res) => { const youch = new Youch({}, req) res.writeHead(200, {'content-type': 'application/json'})