diff --git a/.travis.yml b/.travis.yml index 6ac9856..205059d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,9 @@ language: node_js node_js: - - "5" - - "5.1" - - "4" - - "4.2" - - "4.1" - - "4.0" - - "0.12" - - "0.11" - - "iojs" + - "8.11.1" install: + - npm install @types/blue-tape - npm install blue-tape - npm install rimraf - npm install tap-diff diff --git a/lib/index.spec.d.ts b/lib/index.spec.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/lib/index.spec.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/lib/index.spec.js b/lib/index.spec.js deleted file mode 100644 index 84d152f..0000000 --- a/lib/index.spec.js +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/* tslint:disable:no-shadowed-variable */ -const test = require("blue-tape"); -const index_1 = require("./index"); -const command = function (command, callback) { - const promise = Promise.resolve().then(function () { - return Promise.resolve('do some work and return result ' + command); - }).then(function (data) { - //console.log(data); - return data; - }); - return index_1.default(promise, callback); -}; -const commandWillFail = function (command, callback) { - const promise = Promise.resolve().then(function () { - return Promise.reject('do some work and reject ' + command); - }).then(function (data) { - //console.log(data); - return data; - }); - return index_1.default(promise, callback); -}; -test('nodeify', t => { - t.test('promise', t => { - return command('with promise').then(function (data) { - t.equal(data, 'do some work and return result with promise'); - }); - }); - t.test('callback', t => { - command('with callback', function (err, data) { - t.equal(data, 'do some work and return result with callback'); - t.end(); - }); - }); -}); -test('nodeify should fail', t => { - t.test('promise', t => { - return commandWillFail('with promise').then(function (data) { - console.log('data', data); - }).catch((e) => { - t.equal(e, 'do some work and reject with promise'); - }); - }); - t.test('callback', t => { - commandWillFail('with callback', function (err, data) { - t.equal(err, 'do some work and reject with callback'); - t.equal(null, data); - t.end(); - }); - }); -}); diff --git a/package.json b/package.json index 20c5ab9..32af583 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,17 @@ { "name": "nodeify-ts", - "version": "1.0.4", + "version": "1.0.5", "description": "Create functions that both return promises and accept node-style callbacks", - "main": "dist/index.js", - "typings": "dist/index", + "main": "lib/index.js", "files": [ "lib/" ], "scripts": { "lint": "tslint src/**/*.ts", - "build": "rimraf dist/ && tsc", + "build": "rimraf lib/ && tsc", "test-spec": "ts-node node_modules/blue-tape/bin/blue-tape.js \"src/**/*.spec.ts\" | tap-diff", "test": "npm run lint && npm run build && npm run test-spec", - "prepare": "npm run lint && npm run build && rimraf dist/**/*.spec.* " + "prepare": "npm run lint && npm run build && rimraf lib/**/*.spec.* " }, "repository": { "type": "git",