Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
set of patches and tests to fix #108
Browse files Browse the repository at this point in the history
  • Loading branch information
igorklopov committed Aug 1, 2017
1 parent f59ec6b commit b6d9d1a
Show file tree
Hide file tree
Showing 20 changed files with 116 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dictionary/bcrypt.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
'use strict';

module.exports = {
};
4 changes: 4 additions & 0 deletions dictionary/newrelic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
'use strict';

module.exports = {
};
4 changes: 4 additions & 0 deletions dictionary/nib.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
'use strict';

module.exports = {
};
4 changes: 4 additions & 0 deletions dictionary/raven.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
'use strict';

module.exports = {
};
9 changes: 9 additions & 0 deletions dictionary/sharp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

module.exports = {
pkg: {
scripts: [
'lib/*.js'
]
}
};
9 changes: 9 additions & 0 deletions dictionary/stylus.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

module.exports = {
pkg: {
assets: [
'lib/**/*.styl'
]
}
};
14 changes: 14 additions & 0 deletions test/test-79-npm/bcrypt/bcrypt.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict';

var bcrypt = require('bcrypt');
const saltRounds = 10;
const myPlaintextPassword = 'P4$$w0rD';
bcrypt.genSalt(saltRounds, function (error, salt) {
if (error) return;
bcrypt.hash(myPlaintextPassword, salt, function (error2, hash) {
if (error2) return;
if (typeof hash === 'string') {
console.log('ok');
}
});
});
1 change: 1 addition & 0 deletions test/test-79-npm/bcrypt/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "private": true }
13 changes: 13 additions & 0 deletions test/test-79-npm/newrelic/newrelic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use strict';

var fs = require('fs');
process.env.NEW_RELIC_APP_NAME = 'pkg-test';
process.env.NEW_RELIC_NO_CONFIG_FILE = true;
var Agent = require('newrelic/lib/agent.js');
Agent.prototype.start = function () {
console.log('ok');
fs.unlinkSync('newrelic_agent.log');
process.exit();
};

require('newrelic');
1 change: 1 addition & 0 deletions test/test-79-npm/newrelic/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "private": true }
6 changes: 6 additions & 0 deletions test/test-79-npm/nib/nib.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
'use strict';

var nib = require('nib');
if (typeof nib.version === 'string') {
console.log('ok');
}
1 change: 1 addition & 0 deletions test/test-79-npm/nib/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "private": true }
1 change: 1 addition & 0 deletions test/test-79-npm/raven/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "private": true }
4 changes: 4 additions & 0 deletions test/test-79-npm/raven/raven.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
'use strict';

require('raven');
console.log('ok');
1 change: 1 addition & 0 deletions test/test-79-npm/sharp/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "private": true }
13 changes: 13 additions & 0 deletions test/test-79-npm/sharp/sharp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use strict';

var sharp = require('sharp');

var source = Buffer.from(
'<svg><rect x="0" y="0" width="100" height="100" rx="50" ry="50"/></svg>'
);

sharp(source).rotate().toBuffer().then(function (output) {
if (output.slice(1, 4).toString() === 'PNG') {
console.log('ok');
}
});
3 changes: 3 additions & 0 deletions test/test-79-npm/stylus/external.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.foo .bar {
width: 10px;
}
1 change: 1 addition & 0 deletions test/test-79-npm/stylus/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "private": true }
8 changes: 8 additions & 0 deletions test/test-79-npm/stylus/stylus.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"bin": "stylus.js",
"pkg": {
"assets": [
"external.css"
]
}
}
15 changes: 15 additions & 0 deletions test/test-79-npm/stylus/stylus.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

var path = require('path');
var stylus = require('stylus');
var s = '@require "external.css"';
var opts = { filename: 'index.css', paths: [ __dirname ] };
var dep = stylus(s, opts).deps()[0];
if (path.basename(dep) === 'external.css') {
stylus.render(s, opts, function (error, css) {
if (error) return;
if (css === '@import "external.css";\n') {
console.log('ok');
}
});
}

0 comments on commit b6d9d1a

Please sign in to comment.