Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

express-promise-router

Package Overview
Dependencies
Maintainers
2
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-promise-router - npm Package Compare versions

Comparing version 3.0.1 to 3.0.2-rc.1

LICENSE

6

index.d.ts
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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc