Files
meteor/tools/tests/npm.js
2014-06-26 17:32:17 -07:00

39 lines
1.2 KiB
JavaScript

var selftest = require('../selftest.js');
var Sandbox = selftest.Sandbox;
var utils = require('../utils.js');
var net = require('net');
var Future = require('fibers/future');
var _ = require('underscore');
var files = require('../files.js');
var MONGO_LISTENING =
{ stdout: " [initandlisten] waiting for connections on port" };
selftest.define("npm", ["net"], function () {
var s = new Sandbox({ fakeMongo: true });
var run;
s.createApp("npmtestapp", "npmtest");
s.cd("npmtestapp");
// Ensure that we don't lose the executable bits of npm modules.
// Regression test for https://github.com/meteor/meteor/pull/1808
// Before this fix, the module would work on the first execution but not on a
// subsequent one.
_.times(2, function (i) {
run = s.run("--once", "--raw-logs");
run.tellMongo(MONGO_LISTENING);
if (i === 0) {
run.waitSecs(2);
// use match instead of read because on a built release we can
// also get an update message here.
run.match(
"npm-test: updating npm dependencies -- meteor-test-executable...\n");
}
run.waitSecs(15);
run.match("null; From shell script\n");
run.expectEnd();
run.expectExit(0);
});
});