Skip to content

Commit 8f1d8f5

Browse files
Nico Jenschdr460nf1r3
authored andcommitted
Vendored pnpm integration tests
1 parent 924d692 commit 8f1d8f5

591 files changed

Lines changed: 85896 additions & 86 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@
88
/pkg/
99
!vendor/**
1010
build
11-
node_modules

fixtures/pnpm/unmet/package.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

fixtures/pnpm/unmet/pnpm-lock.yaml

Lines changed: 0 additions & 75 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
var logfmt = require('../logfmt'),
2+
assert = require('assert');
3+
4+
var OutStream = require('./outstream');
5+
6+
suite('logfmt.log', function() {
7+
test("passing location as second param", function(){
8+
var mock_sink = new OutStream;
9+
var data = {foo: 'bar', a: 14}
10+
logfmt.log(data, mock_sink);
11+
assert.equal("foo=bar a=14\n", mock_sink.logline)
12+
})
13+
14+
test("setting sink at object level", function(){
15+
var mock_sink = new OutStream;
16+
var data = {foo: "hello kitty"}
17+
var stream = logfmt.stream;
18+
logfmt.stream = mock_sink;
19+
logfmt.log(data);
20+
assert.equal("foo=\"hello kitty\"\n", mock_sink.logline)
21+
logfmt.stream = stream;
22+
})
23+
})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--ui qunit
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
var it = require('it-is').style('colour')
2+
, split = require('..')
3+
4+
exports ['emit mapper exceptions as error events'] = function (test) {
5+
var s = split(JSON.parse)
6+
, caughtError = false
7+
, rows = []
8+
9+
s.on('error', function (err) {
10+
caughtError = true
11+
})
12+
13+
s.on('data', function (row) { rows.push(row) })
14+
15+
s.write('{"a":1}\n{"')
16+
it(caughtError).equal(false)
17+
it(rows).deepEqual([ { a: 1 } ])
18+
19+
s.write('b":2}\n{"c":}\n')
20+
it(caughtError).equal(true)
21+
it(rows).deepEqual([ { a: 1 }, { b: 2 } ])
22+
23+
s.end()
24+
test.done()
25+
}
26+
27+
exports ['mapper error events on trailing chunks'] = function (test) {
28+
var s = split(JSON.parse)
29+
, caughtError = false
30+
, rows = []
31+
32+
s.on('error', function (err) {
33+
caughtError = true
34+
})
35+
36+
s.on('data', function (row) { rows.push(row) })
37+
38+
s.write('{"a":1}\n{"')
39+
it(caughtError).equal(false)
40+
it(rows).deepEqual([ { a: 1 } ])
41+
42+
s.write('b":2}\n{"c":}')
43+
it(caughtError).equal(false)
44+
it(rows).deepEqual([ { a: 1 }, { b: 2 } ])
45+
46+
s.end()
47+
it(caughtError).equal(true)
48+
it(rows).deepEqual([ { a: 1 }, { b: 2 } ])
49+
50+
test.done()
51+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
0.2.0 / 2013-08-11
3+
==================
4+
5+
* fix: return false for no-cache
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#! /usr/bin/env node
2+
3+
app = require('./express_buffered');
4+
var http = require('http');
5+
6+
var options = {
7+
hostname: 'localhost',
8+
port: 3000,
9+
path: '/logs',
10+
method: 'POST',
11+
headers: {
12+
'Content-Type':'application/logplex-1'
13+
}
14+
};
15+
16+
var req = http.request(options, function(res) {
17+
console.log('STATUS: ' + res.statusCode);
18+
console.log('HEADERS: ' + JSON.stringify(res.headers));
19+
res.setEncoding('utf8');
20+
res.on('data', function (chunk) {
21+
console.log('BODY: ' + chunk);
22+
});
23+
res.on('end', function(){
24+
console.log('end of request')
25+
process.exit(0);
26+
})
27+
});
28+
29+
req.on('error', function(e) {
30+
console.log('problem with request: ' + e.message);
31+
});
32+
33+
// write data to request body
34+
req.write('foo=bar a=14 baz="hello kitty" cool%story=bro f %^asdf\n');
35+
req.write('at=error code=H12 desc="Request timeout" method=GET path=/users/user38948@heroku.com/usage/2013-05-01T00:00:00Z/2013-05-01T00:00:00Z?exclude=platform%3Adyno%3Aphysical host=vault-usage-read.herokuapp.com fwd="50.17.15.69" dyno=web.21 connect=17ms service=30000ms status=503 bytes=0\n');
36+
37+
req.end();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "type-is",
3+
"description": "Infer the content type if a request",
4+
"version": "1.0.0",
5+
"author": {
6+
"name": "Jonathan Ong",
7+
"email": "me@jongleberry.com",
8+
"url": "http://jongleberry.com",
9+
"twitter": "https://twitter.com/jongleberry"
10+
},
11+
"license": "MIT",
12+
"repository": {
13+
"type": "git",
14+
"url": "https://github.com/expressjs/type-is.git"
15+
},
16+
"bugs": {
17+
"mail": "me@jongleberry.com",
18+
"url": "https://github.com/expressjs/type-is/issues"
19+
},
20+
"dependencies": {
21+
"mime": "~1.2.11"
22+
},
23+
"devDependencies": {
24+
"mocha": "*",
25+
"should": "*"
26+
},
27+
"scripts": {
28+
"test": "make test"
29+
}
30+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
(function() {
2+
var configuration, preferredCharsets, testConfigurations, testCorrectCharset, _i, _len,
3+
_this = this;
4+
5+
preferredCharsets = require('../lib/charset').preferredCharsets;
6+
7+
this["Should not return a charset when no charset is provided"] = function(test) {
8+
test.deepEqual(preferredCharsets('*', []), []);
9+
return test.done();
10+
};
11+
12+
this["Should not return a charset when no charset is acceptable"] = function(test) {
13+
test.deepEqual(preferredCharsets('ISO-8859-1', ['utf-8']), []);
14+
return test.done();
15+
};
16+
17+
this["Should not return a charset with q = 0"] = function(test) {
18+
test.deepEqual(preferredCharsets('utf-8;q=0', ['utf-8']), []);
19+
return test.done();
20+
};
21+
22+
testCorrectCharset = function(c) {
23+
return _this["Should return " + c.selected + " for accept-charset header " + c.accept + " with provided charset " + c.provided] = function(test) {
24+
test.deepEqual(preferredCharsets(c.accept, c.provided), c.selected);
25+
return test.done();
26+
};
27+
};
28+
29+
testConfigurations = [
30+
{
31+
accept: 'utf-8',
32+
provided: ['utf-8'],
33+
selected: ['utf-8']
34+
}, {
35+
accept: '*',
36+
provided: ['utf-8'],
37+
selected: ['utf-8']
38+
}, {
39+
accept: 'utf-8',
40+
provided: ['utf-8', 'ISO-8859-1'],
41+
selected: ['utf-8']
42+
}, {
43+
accept: 'utf-8, ISO-8859-1',
44+
provided: ['utf-8'],
45+
selected: ['utf-8']
46+
}, {
47+
accept: 'utf-8;q=0.8, ISO-8859-1',
48+
provided: ['utf-8', 'ISO-8859-1'],
49+
selected: ['ISO-8859-1', 'utf-8']
50+
}, {
51+
accept: 'utf-8;q=0.8, ISO-8859-1',
52+
provided: null,
53+
selected: ['ISO-8859-1', 'utf-8']
54+
}
55+
];
56+
57+
for (_i = 0, _len = testConfigurations.length; _i < _len; _i++) {
58+
configuration = testConfigurations[_i];
59+
testCorrectCharset(configuration);
60+
}
61+
62+
}).call(this);

0 commit comments

Comments
 (0)