express-promise-router
Advanced tools
Comparing version 3.0.1 to 3.0.2-rc.1
declare module 'express-promise-router' { | ||
import {Router, RouterOptions} from 'express' | ||
import { Router, RouterOptions } from 'express'; | ||
function PromiseRouter(options?: RouterOptions): Router | ||
function PromiseRouter(options?: RouterOptions): Router; | ||
export default PromiseRouter | ||
export default PromiseRouter; | ||
} |
@@ -113,2 +113,3 @@ 'use strict'; | ||
PromiseRouter.default = PromiseRouter; | ||
module.exports = PromiseRouter; |
{ | ||
"name": "express-promise-router", | ||
"version": "3.0.1", | ||
"version": "3.0.2-rc.1", | ||
"main": "lib/express-promise-router.js", | ||
@@ -45,2 +45,4 @@ "description": "A lightweight wrapper for Express 4's Router that allows middleware to return promises", | ||
"@types/express": "^4.11.0", | ||
"babel-core": "^6.26.0", | ||
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.0", | ||
"chai": "^4.0.0", | ||
@@ -60,7 +62,7 @@ "eslint": "^4.0.0", | ||
"scripts": { | ||
"format": "prettier --write --trailing-comma es5 --print-width 120 --single-quote --tab-width 4 'lib/*.js' 'test/*.js'", | ||
"format": "prettier --write --trailing-comma es5 --print-width 120 --single-quote --tab-width 4 'lib/**/*.js' 'test/**/*.js' 'index.d.ts' 'test/**/*.ts'", | ||
"lint": "eslint {lib,test}/**/*.js", | ||
"unit-tests": "mocha test/**/*.js", | ||
"unit-tests": "mocha test/*.test.js", | ||
"test": "npm run-script lint && npm run-script unit-tests" | ||
} | ||
} |
@@ -6,3 +6,3 @@ 'use strict'; | ||
var express = require('express'); | ||
var request = require('request-promise'); | ||
var GET = require('./util/http-utils').GET; | ||
@@ -23,11 +23,2 @@ var delay = function(method, payload) { | ||
var GET = function(route) { | ||
return request({ url: 'http://localhost:12345' + route, resolveWithFullResponse: true }).then(function(res) { | ||
// Express sends 500 errors for uncaught exceptions (like failed assertions) | ||
// Make sure to still fail the test if an assertion in middleware failed. | ||
assert.equal(res.statusCode, 200); | ||
return res; | ||
}); | ||
}; | ||
var bootstrap = function(router) { | ||
@@ -34,0 +25,0 @@ app = express(); |
@@ -6,3 +6,3 @@ 'use strict'; | ||
var express = require('express'); | ||
var request = require('request-promise'); | ||
var GET = require('./util/http-utils').GET; | ||
@@ -23,11 +23,2 @@ var delay = function(method, payload) { | ||
var GET = function(route) { | ||
return request({ url: 'http://localhost:12345' + route, resolveWithFullResponse: true }).then(function(res) { | ||
// Express sends 500 errors for uncaught exceptions (like failed assertions) | ||
// Make sure to still fail the test if an assertion in middleware failed. | ||
assert.equal(res.statusCode, 200); | ||
return res; | ||
}); | ||
}; | ||
var bootstrap = function(router) { | ||
@@ -34,0 +25,0 @@ app = express(); |
@@ -5,2 +5,6 @@ 'use strict'; | ||
var path = require('path'); | ||
var resolve = require('path').resolve; | ||
var assert = require('chai').assert; | ||
var spawnTypeScript = require('./util/launch-utils').spawnTypeScript; | ||
var GET = require('./util/http-utils').GET; | ||
@@ -10,4 +14,31 @@ describe('TypeScript', function() { | ||
this.timeout(20000); | ||
tt.compile([path.resolve(__dirname + '/typescript-resources/base-case.ts')], {}, done.bind(null)); | ||
tt.compile([path.resolve(__dirname + '/typescript-resources/typescript-base-case.ts')], {}, done.bind(null)); | ||
}); | ||
it('should run the example and respond', function(done) { | ||
this.timeout(5000); | ||
var ts_file = resolve(__dirname, './test-resources/typescript-base-case.ts'); | ||
var target = spawnTypeScript(ts_file); | ||
var called = false; | ||
target.stdout.on('data', function(data) { | ||
if (data.toString().indexOf('START') === -1) { | ||
return; | ||
} | ||
GET('/').then(function() { | ||
called = true; | ||
target.kill('SIGINT'); | ||
}); | ||
}); | ||
target.stderr.on('data', function(data) { | ||
console.error(data.toString()); | ||
}); | ||
target.on('close', function() { | ||
assert(called); | ||
done(); | ||
}); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37323
21
909
14
1
1
1