New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

npm-registry-mock

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-registry-mock - npm Package Compare versions

Comparing version

to
0.5.1

test/fixtures/index.js

2

index.js

@@ -25,3 +25,3 @@ var path = require('path')

var customTarget = mocks[method][route][1]
var isTarball = /.tgz$/.test(route)
var isTarball = /(.tgz|.js)$/.test(route)
if (isTarball) {

@@ -28,0 +28,0 @@ var target = __dirname + path.sep + "fixtures" + route.replace(/\//g, path.sep);

{
"name": "npm-registry-mock",
"version": "0.5.0",
"version": "0.5.1",
"description": "mock the npm registry",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -120,2 +120,18 @@ var assert = require("assert")

})
it("serves js-files", function (done) {
var customMocks = {
"get": {
"/foo.js": [200, __dirname + "/fixtures/index.js"]
}
}
var file = fs.readFileSync(__dirname + "/fixtures/index.js", "utf8")
mr({port: 1331, mocks: customMocks}, function (s) {
request(address + "/foo.js", function (er, res) {
assert.equal(res.body, file)
s.close()
done()
})
})
})
})

@@ -122,0 +138,0 @@