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

mocha-phantomjs-core

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mocha-phantomjs-core - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

6

browser-shim.js

@@ -17,3 +17,6 @@ (function(){

var scriptTags = document.querySelectorAll('script'),
mochaScript = scriptTags[scriptTags.length - 1]
mochaScript = Array.prototype.filter.call(scriptTags, function(s) {
var src = s.getAttribute('src')
return src && src.match(/mocha\.js$/)
})[0]

@@ -40,2 +43,3 @@ function isFileReady(readyState) {

mocha.run = function() {
window.callPhantom({ testRunStarted: mocha.suite.suites.length })
mocha.runner = origRun.apply(mocha, arguments)

@@ -42,0 +46,0 @@ if (mocha.runner.stats && mocha.runner.stats.end) {

@@ -9,2 +9,3 @@ var

configured = false,
runStarted = false,
hookData

@@ -85,3 +86,3 @@

page.onResourceReceived = function(resource) {
if (resource.url.match(/mocha\.js/)) {
if (resource.url.match(/mocha\.js$/)) {
page.injectJs('browser-shim.js')

@@ -98,2 +99,7 @@ }

configureMocha()
} else if ('testRunStarted' in data) {
if (data.testRunStarted == 0) {
fail('mocha.run() was called with no tests')
}
runStarted = true
} else if (data.testRunEnded) {

@@ -116,3 +122,10 @@ if (typeof config.hooks.afterEnd === 'function') {

} else if (!configured) {
fail('Failed to run any tests.')
fail('mocha was not initialized before the page finished loading. Make sure to include mocha.js as a direct script and call `mocha.ui` or `mocha.setup`.')
} else if (!runStarted) {
var timeout = config.timeout || 10000
setTimeout(function() {
if (!runStarted) {
fail('mocha.run() was not called within ' + timeout + 'ms of the page loading.')
}
}, timeout)
}

@@ -119,0 +132,0 @@ }

5

package.json

@@ -12,3 +12,3 @@ {

],
"version": "1.0.1",
"version": "1.1.0",
"author": "Nathan Black <nathan@nathanblack.org> (https://github.com/nathanboktae)",

@@ -39,4 +39,5 @@ "licenses": [

"co-mocha": "^1.1.0",
"coffee-script": "^1.9.1"
"coffee-script": "^1.9.1",
"requirejs": "^2.1.20"
}
}

@@ -49,2 +49,6 @@ # Run Mocha tests in PhantomJS

#### `timeout`
Time in milliseconds after the page loads that `mocha.run` needs to be called. Defaults to 10 seconds.
#### `viewportSize`

@@ -51,0 +55,0 @@

Sorry, the diff of this file is not supported yet

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