mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Move jasmine-focused to spec folder
This JS file was previously loaded in the vendor folder even though it was internally written. It has also been converted to CoffeeScript.
This commit is contained in:
30
spec/jasmine-focused.coffee
Normal file
30
spec/jasmine-focused.coffee
Normal file
@@ -0,0 +1,30 @@
|
||||
setGlobalFocusPriority = (priority) ->
|
||||
env = jasmine.getEnv()
|
||||
env.focusPriority = 1 unless env.focusPriority
|
||||
env.focusPriority = priority if priority > env.focusPriority
|
||||
|
||||
window.fdescribe = (description, specDefinitions, priority) ->
|
||||
priority = 1 unless priority
|
||||
setGlobalFocusPriority(priority)
|
||||
suite = describe(description, specDefinitions)
|
||||
suite.focusPriority = priority
|
||||
suite
|
||||
|
||||
window.ffdescribe = (description, specDefinitions) ->
|
||||
fdescribe(description, specDefinitions, 2)
|
||||
|
||||
window.fffdescribe = (description, specDefinitions) ->
|
||||
fdescribe(description, specDefinitions, 3)
|
||||
|
||||
window.fit = (description, definition, priority) ->
|
||||
priority = 1 unless priority
|
||||
setGlobalFocusPriority(priority)
|
||||
spec = it(description, definition)
|
||||
spec.focusPriority = priority
|
||||
spec
|
||||
|
||||
window.ffit = (description, specDefinitions) ->
|
||||
fit(description, specDefinitions, 2)
|
||||
|
||||
window.fffit = (description, specDefinitions) ->
|
||||
fit(description, specDefinitions, 3)
|
||||
37
vendor/jasmine-focused.js
vendored
37
vendor/jasmine-focused.js
vendored
@@ -1,37 +0,0 @@
|
||||
var setGlobalFocusPriority = function(priority) {
|
||||
env = jasmine.getEnv();
|
||||
if (!env.focusPriority) env.focusPriority = 1;
|
||||
if (priority > env.focusPriority) env.focusPriority = priority;
|
||||
};
|
||||
|
||||
var fdescribe = function(description, specDefinitions, priority) {
|
||||
if (!priority) priority = 1;
|
||||
setGlobalFocusPriority(priority)
|
||||
var suite = describe(description, specDefinitions);
|
||||
suite.focusPriority = priority;
|
||||
return suite;
|
||||
};
|
||||
|
||||
var ffdescribe = function(description, specDefinitions) {
|
||||
fdescribe(description, specDefinitions, 2);
|
||||
};
|
||||
|
||||
var fffdescribe = function(description, specDefinitions) {
|
||||
fdescribe(description, specDefinitions, 3);
|
||||
};
|
||||
|
||||
var fit = function(description, definition, priority) {
|
||||
if (!priority) priority = 1;
|
||||
setGlobalFocusPriority(priority);
|
||||
var spec = it(description, definition);
|
||||
spec.focusPriority = priority;
|
||||
return spec;
|
||||
};
|
||||
|
||||
var ffit = function(description, specDefinitions) {
|
||||
fit(description, specDefinitions, 2);
|
||||
};
|
||||
|
||||
var fffit = function(description, specDefinitions) {
|
||||
fit(description, specDefinitions, 3);
|
||||
};
|
||||
2
vendor/jasmine-helper.coffee
vendored
2
vendor/jasmine-helper.coffee
vendored
@@ -11,7 +11,7 @@ module.exports.runSpecSuite = (specSuite, logErrors=true) ->
|
||||
{$$} = require 'space-pen'
|
||||
nakedLoad 'jasmine'
|
||||
nakedLoad 'jasmine-console-reporter'
|
||||
nakedLoad 'jasmine-focused'
|
||||
require 'jasmine-focused'
|
||||
|
||||
AtomReporter = require 'atom-reporter'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user