jasmine-core 3.6.0 → 3.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f216c9ede11495c789c3403db642a8ff9fc5aee6d25ad22356d80acbc528059
4
- data.tar.gz: 9e2cc50ac86cfd8672e138165552c36d3a31d237639b3f8b069bcd0d8321b133
3
+ metadata.gz: f18ca3911368d543ae8408f8b0a3335e4877d5607b7c79d0d294560e6dcc5f71
4
+ data.tar.gz: a4e42a0fa683e962a106f9200e2afce59d58ad3b1610f215e265090de676e2ce
5
5
  SHA512:
6
- metadata.gz: fe9be17fe38e5345998145c7ce83527a847f16a2710b163ab4231d3f6fc7ce092cb41e25375905391484f1357b8b4e00e7cbc3a2ae3cbefeaa841ca1bcfab57d
7
- data.tar.gz: ea5cf016d142717bdf613ea3b66597ee2a7fbc28965427ee3257abc40ba1901ef23af788d681e0eaf208ec0ff7210c19c888571515ed1b8f5f06834ed8151539
6
+ metadata.gz: 7f77c1242debc79d4409c576d2a8463c9e0d4c9582c01b0db6cc9f362aed4cb15356a67b2959f811318d2269b00417e7a1ee5f17f8ac7e2fc8d937b31e57e222
7
+ data.tar.gz: 34af5b076d8b89012961210b1e2dbeff6d7dfd17447deac859df212b7e68d302c108155415b066abd0dae3a1d5962ccb2618c17c27d38890311829847c33fc03
data/lib/jasmine-core.js CHANGED
@@ -5,11 +5,12 @@ var path = require('path'),
5
5
  fs = require('fs');
6
6
 
7
7
  var rootPath = path.join(__dirname, "jasmine-core"),
8
- bootFiles = ['boot.js'],
8
+ bootFiles = ['boot0.js', 'boot1.js'],
9
+ legacyBootFiles = ['boot.js'],
9
10
  nodeBootFiles = ['node_boot.js'],
10
11
  cssFiles = [],
11
12
  jsFiles = [],
12
- jsFilesToSkip = ['jasmine.js'].concat(bootFiles, nodeBootFiles);
13
+ jsFilesToSkip = ['jasmine.js'].concat(bootFiles, legacyBootFiles, nodeBootFiles);
13
14
 
14
15
  fs.readdirSync(rootPath).forEach(function(file) {
15
16
  if(fs.statSync(path.join(rootPath, file)).isFile()) {
data/lib/jasmine-core.rb CHANGED
@@ -6,7 +6,7 @@ module Jasmine
6
6
  end
7
7
 
8
8
  def js_files
9
- (["jasmine.js"] + Dir.glob(File.join(path, "*.js"))).map { |f| File.basename(f) }.uniq - boot_files - node_boot_files
9
+ (["jasmine.js"] + Dir.glob(File.join(path, "*.js"))).map { |f| File.basename(f) }.uniq - boot_files - ["boot0.js", "boot1.js"] - node_boot_files
10
10
  end
11
11
 
12
12
  SPEC_TYPES = ["core", "html", "node"]
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright (c) 2008-2020 Pivotal Labs
2
+ Copyright (c) 2008-2021 Pivotal Labs
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person obtaining
5
5
  a copy of this software and associated documentation files (the
@@ -21,6 +21,10 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
21
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
22
  */
23
23
  /**
24
+
25
+ NOTE: This file is deprecated and will be removed in a future release.
26
+ Include both boot0.js and boot1.js (in that order) instead.
27
+
24
28
  Starting with version 2.0, this file "boots" Jasmine, performing all of the necessary initialization before executing the loaded environment and all of a project's specs. This file should be loaded after `jasmine.js` and `jasmine_html.js`, but before any project source files or spec files are loaded. Thus this file can also be used to customize Jasmine for a project.
25
29
 
26
30
  If a project is using Jasmine via the standalone distribution, this file can be customized directly. If a project is using Jasmine via the [Ruby gem][jasmine-gem], this file can be copied into the support directory via `jasmine copy_boot_js`. Other environments (e.g., Python) will have different mechanisms.
@@ -1,4 +1,8 @@
1
1
  /**
2
+
3
+ NOTE: This file is deprecated and will be removed in a future release.
4
+ Include both boot0.js and boot1.js (in that order) instead.
5
+
2
6
  Starting with version 2.0, this file "boots" Jasmine, performing all of the necessary initialization before executing the loaded environment and all of a project's specs. This file should be loaded after `jasmine.js` and `jasmine_html.js`, but before any project source files or spec files are loaded. Thus this file can also be used to customize Jasmine for a project.
3
7
 
4
8
  If a project is using Jasmine via the standalone distribution, this file can be customized directly. If a project is using Jasmine via the [Ruby gem][jasmine-gem], this file can be copied into the support directory via `jasmine copy_boot_js`. Other environments (e.g., Python) will have different mechanisms.
@@ -0,0 +1,42 @@
1
+ /**
2
+ This file starts the process of "booting" Jasmine. It initializes Jasmine,
3
+ makes its globals available, and creates the env. This file should be loaded
4
+ after `jasmine.js` and `jasmine_html.js`, but before `boot1.js` or any project
5
+ source files or spec files are loaded.
6
+ */
7
+ (function() {
8
+ var jasmineRequire = window.jasmineRequire || require('./jasmine.js');
9
+
10
+ /**
11
+ * ## Require & Instantiate
12
+ *
13
+ * Require Jasmine's core files. Specifically, this requires and attaches all of Jasmine's code to the `jasmine` reference.
14
+ */
15
+ var jasmine = jasmineRequire.core(jasmineRequire),
16
+ global = jasmine.getGlobal();
17
+ global.jasmine = jasmine;
18
+
19
+ /**
20
+ * Since this is being run in a browser and the results should populate to an HTML page, require the HTML-specific Jasmine code, injecting the same reference.
21
+ */
22
+ jasmineRequire.html(jasmine);
23
+
24
+ /**
25
+ * Create the Jasmine environment. This is used to run all specs in a project.
26
+ */
27
+ var env = jasmine.getEnv();
28
+
29
+ /**
30
+ * ## The Global Interface
31
+ *
32
+ * Build up the functions that will be exposed as the Jasmine public interface. A project can customize, rename or alias any of these functions as desired, provided the implementation remains unchanged.
33
+ */
34
+ var jasmineInterface = jasmineRequire.interface(jasmine, env);
35
+
36
+ /**
37
+ * Add all of the Jasmine global/public interface to the global scope, so a project can use the public interface directly. For example, calling `describe` in specs instead of `jasmine.getEnv().describe`.
38
+ */
39
+ for (var property in jasmineInterface) {
40
+ global[property] = jasmineInterface[property];
41
+ }
42
+ }());
@@ -0,0 +1,111 @@
1
+ /**
2
+ This file finishes "booting" Jasmine, performing all of the necessary
3
+ initialization before executing the loaded environment and all of a project's
4
+ specs. This file should be loaded after `boot0.js` but before any project
5
+ source files or spec files are loaded. Thus this file can also be used to
6
+ customize Jasmine for a project.
7
+
8
+ If a project is using Jasmine via the standalone distribution, this file can
9
+ be customized directly. If you only wish to configure the Jasmine env, you
10
+ can load another file that calls `jasmine.getEnv().configure({...})`
11
+ after `boot0.js` is loaded and before this file is loaded.
12
+ */
13
+
14
+ (function() {
15
+ var env = jasmine.getEnv();
16
+
17
+ /**
18
+ * ## Runner Parameters
19
+ *
20
+ * More browser specific code - wrap the query string in an object and to allow for getting/setting parameters from the runner user interface.
21
+ */
22
+
23
+ var queryString = new jasmine.QueryString({
24
+ getWindowLocation: function() { return window.location; }
25
+ });
26
+
27
+ var filterSpecs = !!queryString.getParam("spec");
28
+
29
+ var config = {
30
+ failFast: queryString.getParam("failFast"),
31
+ oneFailurePerSpec: queryString.getParam("oneFailurePerSpec"),
32
+ hideDisabled: queryString.getParam("hideDisabled")
33
+ };
34
+
35
+ var random = queryString.getParam("random");
36
+
37
+ if (random !== undefined && random !== "") {
38
+ config.random = random;
39
+ }
40
+
41
+ var seed = queryString.getParam("seed");
42
+ if (seed) {
43
+ config.seed = seed;
44
+ }
45
+
46
+ /**
47
+ * ## Reporters
48
+ * The `HtmlReporter` builds all of the HTML UI for the runner page. This reporter paints the dots, stars, and x's for specs, as well as all spec names and all failures (if any).
49
+ */
50
+ var htmlReporter = new jasmine.HtmlReporter({
51
+ env: env,
52
+ navigateWithNewParam: function(key, value) { return queryString.navigateWithNewParam(key, value); },
53
+ addToExistingQueryString: function(key, value) { return queryString.fullStringWithNewParam(key, value); },
54
+ getContainer: function() { return document.body; },
55
+ createElement: function() { return document.createElement.apply(document, arguments); },
56
+ createTextNode: function() { return document.createTextNode.apply(document, arguments); },
57
+ timer: new jasmine.Timer(),
58
+ filterSpecs: filterSpecs
59
+ });
60
+
61
+ /**
62
+ * The `jsApiReporter` also receives spec results, and is used by any environment that needs to extract the results from JavaScript.
63
+ */
64
+ env.addReporter(jsApiReporter);
65
+ env.addReporter(htmlReporter);
66
+
67
+ /**
68
+ * Filter which specs will be run by matching the start of the full name against the `spec` query param.
69
+ */
70
+ var specFilter = new jasmine.HtmlSpecFilter({
71
+ filterString: function() { return queryString.getParam("spec"); }
72
+ });
73
+
74
+ config.specFilter = function(spec) {
75
+ return specFilter.matches(spec.getFullName());
76
+ };
77
+
78
+ env.configure(config);
79
+
80
+ /**
81
+ * Setting up timing functions to be able to be overridden. Certain browsers (Safari, IE 8, phantomjs) require this hack.
82
+ */
83
+ window.setTimeout = window.setTimeout;
84
+ window.setInterval = window.setInterval;
85
+ window.clearTimeout = window.clearTimeout;
86
+ window.clearInterval = window.clearInterval;
87
+
88
+ /**
89
+ * ## Execution
90
+ *
91
+ * Replace the browser window's `onload`, ensure it's called, and then run all of the loaded specs. This includes initializing the `HtmlReporter` instance and then executing the loaded Jasmine environment. All of this will happen after all of the specs are loaded.
92
+ */
93
+ var currentWindowOnload = window.onload;
94
+
95
+ window.onload = function() {
96
+ if (currentWindowOnload) {
97
+ currentWindowOnload();
98
+ }
99
+ htmlReporter.initialize();
100
+ env.execute();
101
+ };
102
+
103
+ /**
104
+ * Helper function for readability above.
105
+ */
106
+ function extend(destination, source) {
107
+ for (var property in source) destination[property] = source[property];
108
+ return destination;
109
+ }
110
+
111
+ }());
@@ -0,0 +1,64 @@
1
+ /*
2
+ Copyright (c) 2008-2021 Pivotal Labs
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining
5
+ a copy of this software and associated documentation files (the
6
+ "Software"), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish,
8
+ distribute, sublicense, and/or sell copies of the Software, and to
9
+ permit persons to whom the Software is furnished to do so, subject to
10
+ the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ */
23
+ /**
24
+ This file starts the process of "booting" Jasmine. It initializes Jasmine,
25
+ makes its globals available, and creates the env. This file should be loaded
26
+ after `jasmine.js` and `jasmine_html.js`, but before `boot1.js` or any project
27
+ source files or spec files are loaded.
28
+ */
29
+ (function() {
30
+ var jasmineRequire = window.jasmineRequire || require('./jasmine.js');
31
+
32
+ /**
33
+ * ## Require & Instantiate
34
+ *
35
+ * Require Jasmine's core files. Specifically, this requires and attaches all of Jasmine's code to the `jasmine` reference.
36
+ */
37
+ var jasmine = jasmineRequire.core(jasmineRequire),
38
+ global = jasmine.getGlobal();
39
+ global.jasmine = jasmine;
40
+
41
+ /**
42
+ * Since this is being run in a browser and the results should populate to an HTML page, require the HTML-specific Jasmine code, injecting the same reference.
43
+ */
44
+ jasmineRequire.html(jasmine);
45
+
46
+ /**
47
+ * Create the Jasmine environment. This is used to run all specs in a project.
48
+ */
49
+ var env = jasmine.getEnv();
50
+
51
+ /**
52
+ * ## The Global Interface
53
+ *
54
+ * Build up the functions that will be exposed as the Jasmine public interface. A project can customize, rename or alias any of these functions as desired, provided the implementation remains unchanged.
55
+ */
56
+ var jasmineInterface = jasmineRequire.interface(jasmine, env);
57
+
58
+ /**
59
+ * Add all of the Jasmine global/public interface to the global scope, so a project can use the public interface directly. For example, calling `describe` in specs instead of `jasmine.getEnv().describe`.
60
+ */
61
+ for (var property in jasmineInterface) {
62
+ global[property] = jasmineInterface[property];
63
+ }
64
+ }());
@@ -0,0 +1,133 @@
1
+ /*
2
+ Copyright (c) 2008-2021 Pivotal Labs
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining
5
+ a copy of this software and associated documentation files (the
6
+ "Software"), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish,
8
+ distribute, sublicense, and/or sell copies of the Software, and to
9
+ permit persons to whom the Software is furnished to do so, subject to
10
+ the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ */
23
+ /**
24
+ This file finishes "booting" Jasmine, performing all of the necessary
25
+ initialization before executing the loaded environment and all of a project's
26
+ specs. This file should be loaded after `boot0.js` but before any project
27
+ source files or spec files are loaded. Thus this file can also be used to
28
+ customize Jasmine for a project.
29
+
30
+ If a project is using Jasmine via the standalone distribution, this file can
31
+ be customized directly. If you only wish to configure the Jasmine env, you
32
+ can load another file that calls `jasmine.getEnv().configure({...})`
33
+ after `boot0.js` is loaded and before this file is loaded.
34
+ */
35
+
36
+ (function() {
37
+ var env = jasmine.getEnv();
38
+
39
+ /**
40
+ * ## Runner Parameters
41
+ *
42
+ * More browser specific code - wrap the query string in an object and to allow for getting/setting parameters from the runner user interface.
43
+ */
44
+
45
+ var queryString = new jasmine.QueryString({
46
+ getWindowLocation: function() { return window.location; }
47
+ });
48
+
49
+ var filterSpecs = !!queryString.getParam("spec");
50
+
51
+ var config = {
52
+ failFast: queryString.getParam("failFast"),
53
+ oneFailurePerSpec: queryString.getParam("oneFailurePerSpec"),
54
+ hideDisabled: queryString.getParam("hideDisabled")
55
+ };
56
+
57
+ var random = queryString.getParam("random");
58
+
59
+ if (random !== undefined && random !== "") {
60
+ config.random = random;
61
+ }
62
+
63
+ var seed = queryString.getParam("seed");
64
+ if (seed) {
65
+ config.seed = seed;
66
+ }
67
+
68
+ /**
69
+ * ## Reporters
70
+ * The `HtmlReporter` builds all of the HTML UI for the runner page. This reporter paints the dots, stars, and x's for specs, as well as all spec names and all failures (if any).
71
+ */
72
+ var htmlReporter = new jasmine.HtmlReporter({
73
+ env: env,
74
+ navigateWithNewParam: function(key, value) { return queryString.navigateWithNewParam(key, value); },
75
+ addToExistingQueryString: function(key, value) { return queryString.fullStringWithNewParam(key, value); },
76
+ getContainer: function() { return document.body; },
77
+ createElement: function() { return document.createElement.apply(document, arguments); },
78
+ createTextNode: function() { return document.createTextNode.apply(document, arguments); },
79
+ timer: new jasmine.Timer(),
80
+ filterSpecs: filterSpecs
81
+ });
82
+
83
+ /**
84
+ * The `jsApiReporter` also receives spec results, and is used by any environment that needs to extract the results from JavaScript.
85
+ */
86
+ env.addReporter(jsApiReporter);
87
+ env.addReporter(htmlReporter);
88
+
89
+ /**
90
+ * Filter which specs will be run by matching the start of the full name against the `spec` query param.
91
+ */
92
+ var specFilter = new jasmine.HtmlSpecFilter({
93
+ filterString: function() { return queryString.getParam("spec"); }
94
+ });
95
+
96
+ config.specFilter = function(spec) {
97
+ return specFilter.matches(spec.getFullName());
98
+ };
99
+
100
+ env.configure(config);
101
+
102
+ /**
103
+ * Setting up timing functions to be able to be overridden. Certain browsers (Safari, IE 8, phantomjs) require this hack.
104
+ */
105
+ window.setTimeout = window.setTimeout;
106
+ window.setInterval = window.setInterval;
107
+ window.clearTimeout = window.clearTimeout;
108
+ window.clearInterval = window.clearInterval;
109
+
110
+ /**
111
+ * ## Execution
112
+ *
113
+ * Replace the browser window's `onload`, ensure it's called, and then run all of the loaded specs. This includes initializing the `HtmlReporter` instance and then executing the loaded Jasmine environment. All of this will happen after all of the specs are loaded.
114
+ */
115
+ var currentWindowOnload = window.onload;
116
+
117
+ window.onload = function() {
118
+ if (currentWindowOnload) {
119
+ currentWindowOnload();
120
+ }
121
+ htmlReporter.initialize();
122
+ env.execute();
123
+ };
124
+
125
+ /**
126
+ * Helper function for readability above.
127
+ */
128
+ function extend(destination, source) {
129
+ for (var property in source) destination[property] = source[property];
130
+ return destination;
131
+ }
132
+
133
+ }());
@@ -1,4 +1,33 @@
1
1
  import pkg_resources
2
+ import os
3
+
4
+ if 'SUPPRESS_JASMINE_DEPRECATION' not in os.environ:
5
+ print('DEPRECATION WARNING:\n' +
6
+ '\n' +
7
+ 'The Jasmine packages for Python are deprecated. There will be no further\n' +
8
+ 'releases after the end of the Jasmine 3.x series. We recommend migrating to the\n' +
9
+ 'following options:\n' +
10
+ '\n' +
11
+ '* jasmine-browser-runner (<https://github.com/jasmine/jasmine-browser>,\n' +
12
+ ' `npm install jasmine-browser-runner`) to run specs in browsers, including\n' +
13
+ ' headless Chrome and Saucelabs. This is the most direct replacement for the\n' +
14
+ ' jasmine server` and `jasmine ci` commands provided by the `jasmine` Python\n' +
15
+ ' package.\n' +
16
+ '* The jasmine npm package (<https://github.com/jasmine/jasmine-npm>,\n' +
17
+ ' `npm install jasmine`) to run specs under Node.js.\n' +
18
+ '* The standalone distribution from the latest Jasmine release\n' +
19
+ ' <https://github.com/jasmine/jasmine/releases> to run specs in browsers with\n' +
20
+ ' no additional tools.\n' +
21
+ '* The jasmine-core npm package (`npm install jasmine-core`) if all you need is\n' +
22
+ ' the Jasmine assets. This is the direct equivalent of the jasmine-core Python\n' +
23
+ ' package.\n' +
24
+ '\n' +
25
+ 'Except for the standalone distribution, all of the above are distributed through\n' +
26
+ 'npm.\n' +
27
+ '\n' +
28
+ 'To prevent this message from appearing, set the SUPPRESS_JASMINE_DEPRECATION\n' +
29
+ 'environment variable.\n')
30
+
2
31
 
3
32
  try:
4
33
  from collections import OrderedDict
@@ -29,6 +58,11 @@ class Core(object):
29
58
  js_files.remove('boot.js')
30
59
  js_files.append('boot.js')
31
60
 
61
+ # Remove the new boot files. jasmine-py will continue to use the legacy
62
+ # boot.js.
63
+ js_files.remove('boot0.js')
64
+ js_files.remove('boot1.js')
65
+
32
66
  return cls._uniq(js_files)
33
67
 
34
68
  @classmethod
@@ -57,4 +91,4 @@ class Core(object):
57
91
 
58
92
  seen[marker] = 1
59
93
  result.append(item)
60
- return result
94
+ return result