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

highwind

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

highwind - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

6

lib/mock_api.js

@@ -336,7 +336,7 @@ 'use strict';

}
}).then(function (response) {
}).then(function (data) {
if (saveFixtures) {
saveFixture(fileName, response, responseIsJson);
saveFixture(fileName, data, responseIsJson);
}
serveResponse(res, _extends({}, options, { newResponse: true }));
serveResponse(res, _extends({}, options, { data: data, newResponse: true }));
}).catch(function (err) {

@@ -343,0 +343,0 @@ console.error('==> ⛔️ ' + err);

{
"name": "highwind",
"version": "1.0.3",
"version": "1.0.4",
"description": "Mock API express server",

@@ -5,0 +5,0 @@ "main": "lib/mock_api.js",

@@ -73,3 +73,2 @@ import 'babel-polyfill';

describe('When the request method is GET', function() {
describe('And the saveFixtures setting is set to true', function() {

@@ -104,3 +103,7 @@ beforeEach(function(done) {

.expect('Content-Type', /application\/json/)
.expect(200, response, () => fs.access(responsePath, fs.F_OK, done));
.expect(200)
.end((err, res) => {
expect(res.text).to.equal(JSON.stringify(response));
fs.access(responsePath, fs.F_OK, done);
});
});

@@ -112,3 +115,7 @@

.expect('Content-Type', /application\/json/)
.expect(200, response, () => fs.access(responsePath, fs.F_OK, done));
.expect(200)
.end((err, res) => {
expect(res.text).to.equal(JSON.stringify(response));
fs.access(responsePath, fs.F_OK, done);
});
});

@@ -120,3 +127,7 @@

.expect('Content-Type', /application\/javascript/)
.expect(200, response, () => fs.access(responsePathWithCallback, fs.F_OK, done));
.expect(200)
.end((err, res) => {
expect(res.text).to.equal(JSON.stringify(response));
fs.access(responsePathWithCallback, fs.F_OK, done);
});
});

@@ -146,7 +157,14 @@ });

.expect('Content-Type', /application\/json/)
.expect(200, response, () => fs.access(responsePath, fs.F_OK, (err) => {
if (err) {
done();
}
}));
.expect(200)
.end((err, res) => {
expect(res.text).to.equal(JSON.stringify(response));
fs.access(responsePath, fs.F_OK, (err) => {
if (err) {
return done();
}
throw new Error(
'Saved a fixture with saveFixtures set to false'
);
});
});
});

@@ -153,0 +171,0 @@ });

@@ -249,7 +249,7 @@ import 'babel-polyfill';

})
.then(response => {
.then(data => {
if (saveFixtures) {
saveFixture(fileName, response, responseIsJson);
saveFixture(fileName, data, responseIsJson);
}
serveResponse(res, { ...options, newResponse: true });
serveResponse(res, { ...options, data, newResponse: true });
})

@@ -256,0 +256,0 @@ .catch(err => {

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