jquery/test/node_smoke_tests/lib/ensure_global_not_created.js
Michał Gołębiowski 9c8a3ecdc4 Build: Refactor Node smoke tests
Utilize the assert module, avoid inline JSHint comments.
2015-06-13 23:08:19 +02:00

16 lines
494 B
JavaScript

"use strict";
var assert = require( "assert" );
// Ensure the jQuery property on global/window/module.exports/etc. was not
// created in a CommonJS environment.
// `global` is always checked in addition to passed parameters.
module.exports = function ensureGlobalNotCreated() {
var args = [].slice.call( arguments ).concat( global );
args.forEach( function( object ) {
assert.strictEqual( object.jQuery, undefined,
"A jQuery global was created in a CommonJS environment." );
} );
};