Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bazel/jasmine

Package Overview
Dependencies
Maintainers
3
Versions
134
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bazel/jasmine - npm Package Compare versions

Comparing version 0.27.1 to 0.27.2

6

package.json

@@ -5,3 +5,3 @@ {

"license": "Apache 2.0",
"version": "0.27.1",
"version": "0.27.2",
"repository": {

@@ -20,3 +20,3 @@ "type" : "git",

"npm_bazel_jasmine": {
"version": "0.27.1",
"version": "0.27.2",
"rootPath": "."

@@ -28,2 +28,2 @@ }

}
}
}

@@ -38,2 +38,17 @@ const fs = require('fs');

// Test sharding support
// See https://docs.bazel.build/versions/master/test-encyclopedia.html#role-of-the-test-runner
const TOTAL_SHARDS = process.env['TEST_TOTAL_SHARDS'];
const SHARD_INDEX = process.env['TEST_SHARD_INDEX'];
// Tell Bazel that this test runner supports sharding by updating the last modified date of the
// magic file
if (TOTAL_SHARDS) {
fs.open(process.env['TEST_SHARD_STATUS_FILE'], 'w', (err, fd) => {
if (err) throw err;
fs.close(fd, err => {
if (err) throw err;
});
});
}
// Set the StackTraceLimit to infinity. This will make stack capturing slower, but more useful.

@@ -82,8 +97,38 @@ // Since we are running tests having proper stack traces is very useful and should be always set to

jrunner.execute();
jrunner.loadSpecs();
const allSpecs = getAllSpecs(jasmine.getEnv());
if (TOTAL_SHARDS) {
// Partition the specs among the shards.
// This ensures that the specs are evenly divided over the shards.
// Also it keeps specs in the same order and prefers to keep specs grouped together.
// This way, common beforeEach/beforeAll setup steps aren't repeated as much over different
// shards.
const start = allSpecs.length * SHARD_INDEX / TOTAL_SHARDS;
const end = allSpecs.length * (SHARD_INDEX + 1) / TOTAL_SHARDS;
jasmine.getEnv().execute(allSpecs.slice(start, end));
} else {
jasmine.getEnv().execute(allSpecs);
}
return 0;
}
function getAllSpecs(jasmineEnv) {
var specs = [];
// Walk the test suite tree depth first and collect all test specs
var stack = [jasmineEnv.topSuite()];
var currentNode;
while (currentNode = stack.pop()) {
if (currentNode instanceof jasmine.Spec) {
specs.unshift(currentNode);
} else if (currentNode instanceof jasmine.Suite) {
stack = stack.concat(currentNode.children);
}
}
return specs.map(s => s.id);
}
if (require.main === module) {
process.exitCode = main(process.argv.slice(2));
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc