workaround sporadic slowdown in GitHub Actions (#5201)

This commit is contained in:
Alex Lam S.L
2021-11-28 00:45:29 +00:00
committed by GitHub
parent 3f8f0e246e
commit 2547542873

View File

@@ -4,34 +4,27 @@ var UglifyJS = require("../..");
describe("spidermonkey export/import sanity test", function() { describe("spidermonkey export/import sanity test", function() {
it("Should produce a functional build when using --self with spidermonkey", function(done) { it("Should produce a functional build when using --self with spidermonkey", function(done) {
this.timeout(60000); this.timeout(120000);
var uglifyjs = '"' + process.argv[0] + '" bin/uglifyjs'; var uglifyjs = '"' + process.argv[0] + '" bin/uglifyjs';
var command = uglifyjs + " --self -cm --wrap SpiderUglify -o spidermonkey | " + var command = [
uglifyjs + " -p spidermonkey -cm"; uglifyjs + " --self -cm --wrap SpiderUglify -o spidermonkey",
uglifyjs + " -p spidermonkey -cm",
exec(command, { ].join(" | ");
maxBuffer: 1048576 exec(command, { maxBuffer: 1048576 }, function(err, stdout) {
}, function(err, stdout) {
if (err) throw err; if (err) throw err;
eval(stdout); eval(stdout);
assert.strictEqual(typeof SpiderUglify, "object"); assert.strictEqual(typeof SpiderUglify, "object");
var result = SpiderUglify.minify("foo([true,,2+3]);"); var result = SpiderUglify.minify("foo([true,,2+3]);");
assert.strictEqual(result.error, undefined); assert.strictEqual(result.error, undefined);
assert.strictEqual(result.code, "foo([!0,,5]);"); assert.strictEqual(result.code, "foo([!0,,5]);");
done(); done();
}); });
}); });
it("Should not add unnecessary escape slashes to regexps", function() { it("Should not add unnecessary escape slashes to RegExp", function() {
var input = "/[\\\\/]/;"; var input = "/[\\\\/]/;";
var ast = UglifyJS.parse(input).to_mozilla_ast(); var ast = UglifyJS.parse(input).to_mozilla_ast();
assert.equal( assert.strictEqual(UglifyJS.AST_Node.from_mozilla_ast(ast).print_to_string(), input);
UglifyJS.AST_Node.from_mozilla_ast(ast).print_to_string(),
input
);
}); });
it("Should judge between directives and strings correctly on import", function() { it("Should judge between directives and strings correctly on import", function() {