importmap_mocha-rails 0.3.4 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- // mocha@10.6.0 in javascript ES2018
1
+ // mocha@11.1.0 in javascript ES2018
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
4
4
  typeof define === 'function' && define.amd ? define(factory) :
@@ -11101,7 +11101,7 @@
11101
11101
  * canonicalType(global) // 'global'
11102
11102
  * canonicalType(new String('foo') // 'object'
11103
11103
  * canonicalType(async function() {}) // 'asyncfunction'
11104
- * canonicalType(await import(name)) // 'module'
11104
+ * canonicalType(Object.create(null)) // 'null-prototype'
11105
11105
  */
11106
11106
  var canonicalType = (exports.canonicalType = function canonicalType(value) {
11107
11107
  if (value === undefined) {
@@ -11110,7 +11110,10 @@
11110
11110
  return 'null';
11111
11111
  } else if (isBuffer(value)) {
11112
11112
  return 'buffer';
11113
+ } else if (Object.getPrototypeOf(value) === null) {
11114
+ return 'null-prototype';
11113
11115
  }
11116
+
11114
11117
  return Object.prototype.toString
11115
11118
  .call(value)
11116
11119
  .replace(/^\[.+\s(.+?)]$/, '$1')
@@ -11176,7 +11179,7 @@
11176
11179
  exports.stringify = function (value) {
11177
11180
  var typeHint = canonicalType(value);
11178
11181
 
11179
- if (!~['object', 'array', 'function'].indexOf(typeHint)) {
11182
+ if (!~['object', 'array', 'function', 'null-prototype'].indexOf(typeHint)) {
11180
11183
  if (typeHint === 'buffer') {
11181
11184
  var json = Buffer.prototype.toJSON.call(value);
11182
11185
  // Based on the toJSON result
@@ -11362,8 +11365,12 @@
11362
11365
  break;
11363
11366
  }
11364
11367
  /* falls through */
11368
+ case 'null-prototype':
11365
11369
  case 'object':
11366
11370
  canonicalizedObj = canonicalizedObj || {};
11371
+ if (typeHint === 'null-prototype' && Symbol.toStringTag in value) {
11372
+ canonicalizedObj['[Symbol.toStringTag]'] = value[Symbol.toStringTag];
11373
+ }
11367
11374
  withStack(value, function () {
11368
11375
  Object.keys(value)
11369
11376
  .sort()
@@ -11631,7 +11638,9 @@
11631
11638
 
11632
11639
  seen.add(obj);
11633
11640
  for (const k in obj) {
11634
- if (Object.prototype.hasOwnProperty.call(obj, k)) {
11641
+ const descriptor = Object.getOwnPropertyDescriptor(obj, k);
11642
+
11643
+ if (descriptor && descriptor.writable) {
11635
11644
  obj[k] = _breakCircularDeps(obj[k]);
11636
11645
  }
11637
11646
  }
@@ -11643,6 +11652,13 @@
11643
11652
 
11644
11653
  return _breakCircularDeps(inputObj);
11645
11654
  };
11655
+
11656
+ /**
11657
+ * Checks if provided input can be parsed as a JavaScript Number.
11658
+ */
11659
+ exports.isNumeric = input => {
11660
+ return !isNaN(parseFloat(input));
11661
+ };
11646
11662
  }(utils$3));
11647
11663
 
11648
11664
  var _nodeResolve_empty = {};
@@ -12960,6 +12976,8 @@
12960
12976
  var clearTimeout$1 = commonjsGlobal.clearTimeout;
12961
12977
  var toString = Object.prototype.toString;
12962
12978
 
12979
+ var MAX_TIMEOUT = Math.pow(2, 31) - 1;
12980
+
12963
12981
  var runnable = Runnable$3;
12964
12982
 
12965
12983
  /**
@@ -13035,8 +13053,7 @@
13035
13053
  }
13036
13054
 
13037
13055
  // Clamp to range
13038
- var INT_MAX = Math.pow(2, 31) - 1;
13039
- var range = [0, INT_MAX];
13056
+ var range = [0, MAX_TIMEOUT];
13040
13057
  ms = utils$2.clamp(ms, range);
13041
13058
 
13042
13059
  // see #1652 for reasoning
@@ -13173,11 +13190,8 @@
13173
13190
  */
13174
13191
  Runnable$3.prototype.resetTimeout = function () {
13175
13192
  var self = this;
13176
- var ms = this.timeout();
13193
+ var ms = this.timeout() || MAX_TIMEOUT;
13177
13194
 
13178
- if (ms === 0) {
13179
- return;
13180
- }
13181
13195
  this.clearTimeout();
13182
13196
  this.timer = setTimeout$2(function () {
13183
13197
  if (self.timeout() === 0) {
@@ -13764,7 +13778,7 @@
13764
13778
  var hook = this._createHook(title, fn);
13765
13779
  this._beforeAll.push(hook);
13766
13780
  this.emit(constants.EVENT_SUITE_ADD_HOOK_BEFORE_ALL, hook);
13767
- return this;
13781
+ return hook;
13768
13782
  };
13769
13783
 
13770
13784
  /**
@@ -13788,7 +13802,7 @@
13788
13802
  var hook = this._createHook(title, fn);
13789
13803
  this._afterAll.push(hook);
13790
13804
  this.emit(constants.EVENT_SUITE_ADD_HOOK_AFTER_ALL, hook);
13791
- return this;
13805
+ return hook;
13792
13806
  };
13793
13807
 
13794
13808
  /**
@@ -13812,7 +13826,7 @@
13812
13826
  var hook = this._createHook(title, fn);
13813
13827
  this._beforeEach.push(hook);
13814
13828
  this.emit(constants.EVENT_SUITE_ADD_HOOK_BEFORE_EACH, hook);
13815
- return this;
13829
+ return hook;
13816
13830
  };
13817
13831
 
13818
13832
  /**
@@ -13836,7 +13850,7 @@
13836
13850
  var hook = this._createHook(title, fn);
13837
13851
  this._afterEach.push(hook);
13838
13852
  this.emit(constants.EVENT_SUITE_ADD_HOOK_AFTER_EACH, hook);
13839
- return this;
13853
+ return hook;
13840
13854
  };
13841
13855
 
13842
13856
  /**
@@ -15289,11 +15303,11 @@
15289
15303
  * @public
15290
15304
  * @example
15291
15305
  * // this reporter needs proper object references when run in parallel mode
15292
- * class MyReporter() {
15306
+ * class MyReporter {
15293
15307
  * constructor(runner) {
15294
- * this.runner.linkPartialObjects(true)
15308
+ * runner.linkPartialObjects(true)
15295
15309
  * .on(EVENT_SUITE_BEGIN, suite => {
15296
- // this Suite may be the same object...
15310
+ * // this Suite may be the same object...
15297
15311
  * })
15298
15312
  * .on(EVENT_TEST_BEGIN, test => {
15299
15313
  * // ...as the `test.parent` property
@@ -16724,11 +16738,12 @@
16724
16738
  module.exports = HTML;
16725
16739
 
16726
16740
  /**
16727
- * Stats template.
16741
+ * Stats template: Result, progress, passes, failures, and duration.
16728
16742
  */
16729
16743
 
16730
16744
  var statsTemplate =
16731
16745
  '<ul id="mocha-stats">' +
16746
+ '<li class="result"></li>' +
16732
16747
  '<li class="progress-contain"><progress class="progress-element" max="100" value="0"></progress><svg class="progress-ring"><circle class="ring-flatlight" stroke-dasharray="100%,0%"/><circle class="ring-highlight" stroke-dasharray="0%,100%"/></svg><div class="progress-text">0%</div></li>' +
16733
16748
  '<li class="passes"><a href="javascript:void(0);">passes:</a> <em>0</em></li>' +
16734
16749
  '<li class="failures"><a href="javascript:void(0);">failures:</a> <em>0</em></li>' +
@@ -16754,18 +16769,35 @@
16754
16769
  var stats = this.stats;
16755
16770
  var stat = fragment(statsTemplate);
16756
16771
  var items = stat.getElementsByTagName('li');
16757
- var passes = items[1].getElementsByTagName('em')[0];
16758
- var passesLink = items[1].getElementsByTagName('a')[0];
16759
- var failures = items[2].getElementsByTagName('em')[0];
16760
- var failuresLink = items[2].getElementsByTagName('a')[0];
16761
- var duration = items[3].getElementsByTagName('em')[0];
16772
+ const resultIndex = 0;
16773
+ const progressIndex = 1;
16774
+ const passesIndex = 2;
16775
+ const failuresIndex = 3;
16776
+ const durationIndex = 4;
16777
+ /** Stat item containing the root suite pass or fail indicator (hasFailures ? '✖' : '✓') */
16778
+ var resultIndicator = items[resultIndex];
16779
+ /** Passes text and count */
16780
+ const passesStat = items[passesIndex];
16781
+ /** Stat item containing the pass count (not the word, just the number) */
16782
+ const passesCount = passesStat.getElementsByTagName('em')[0];
16783
+ /** Stat item linking to filter to show only passing tests */
16784
+ const passesLink = passesStat.getElementsByTagName('a')[0];
16785
+ /** Failures text and count */
16786
+ const failuresStat = items[failuresIndex];
16787
+ /** Stat item containing the failure count (not the word, just the number) */
16788
+ const failuresCount = failuresStat.getElementsByTagName('em')[0];
16789
+ /** Stat item linking to filter to show only failing tests */
16790
+ const failuresLink = failuresStat.getElementsByTagName('a')[0];
16791
+ /** Stat item linking to the duration time (not the word or unit, just the number) */
16792
+ var duration = items[durationIndex].getElementsByTagName('em')[0];
16762
16793
  var report = fragment('<ul id="mocha-report"></ul>');
16763
16794
  var stack = [report];
16764
- var progressText = items[0].getElementsByTagName('div')[0];
16765
- var progressBar = items[0].getElementsByTagName('progress')[0];
16795
+ var progressText = items[progressIndex].getElementsByTagName('div')[0];
16796
+ var progressBar = items[progressIndex].getElementsByTagName('progress')[0];
16766
16797
  var progressRing = [
16767
- items[0].getElementsByClassName('ring-flatlight')[0],
16768
- items[0].getElementsByClassName('ring-highlight')[0]];
16798
+ items[progressIndex].getElementsByClassName('ring-flatlight')[0],
16799
+ items[progressIndex].getElementsByClassName('ring-highlight')[0]
16800
+ ];
16769
16801
  var root = document.getElementById('mocha');
16770
16802
 
16771
16803
  if (!root) {
@@ -16818,6 +16850,10 @@
16818
16850
 
16819
16851
  runner.on(EVENT_SUITE_END, function (suite) {
16820
16852
  if (suite.root) {
16853
+ if (stats.failures === 0) {
16854
+ text(resultIndicator, '✓');
16855
+ stat.className += ' pass';
16856
+ }
16821
16857
  updateStats();
16822
16858
  return;
16823
16859
  }
@@ -16838,6 +16874,10 @@
16838
16874
  });
16839
16875
 
16840
16876
  runner.on(EVENT_TEST_FAIL, function (test) {
16877
+ // Update stat items
16878
+ text(resultIndicator, '✖');
16879
+ stat.className += ' fail';
16880
+
16841
16881
  var el = fragment(
16842
16882
  '<li class="test fail"><h2>%e <a href="%e" class="replay">' +
16843
16883
  playIcon +
@@ -16910,7 +16950,6 @@
16910
16950
  }
16911
16951
 
16912
16952
  function updateStats() {
16913
- // TODO: add to stats
16914
16953
  var percent = ((stats.tests / runner.total) * 100) | 0;
16915
16954
  progressBar.value = percent;
16916
16955
  if (progressText) {
@@ -16936,8 +16975,8 @@
16936
16975
 
16937
16976
  // update stats
16938
16977
  var ms = new Date() - stats.start;
16939
- text(passes, stats.passes);
16940
- text(failures, stats.failures);
16978
+ text(passesCount, stats.passes);
16979
+ text(failuresCount, stats.failures);
16941
16980
  text(duration, (ms / 1000).toFixed(2));
16942
16981
  }
16943
16982
  }
@@ -16951,16 +16990,16 @@
16951
16990
  function makeUrl(s) {
16952
16991
  var search = window.location.search;
16953
16992
 
16954
- // Remove previous grep query parameter if present
16993
+ // Remove previous {grep, fgrep, invert} query parameters if present
16955
16994
  if (search) {
16956
- search = search.replace(/[?&]grep=[^&\s]*/g, '').replace(/^&/, '?');
16995
+ search = search.replace(/[?&](?:f?grep|invert)=[^&\s]*/g, '').replace(/^&/, '?');
16957
16996
  }
16958
16997
 
16959
16998
  return (
16960
16999
  window.location.pathname +
16961
17000
  (search ? search + '&' : '?') +
16962
17001
  'grep=' +
16963
- encodeURIComponent(escapeRe(s))
17002
+ encodeURIComponent(s)
16964
17003
  );
16965
17004
  }
16966
17005
 
@@ -16970,7 +17009,7 @@
16970
17009
  * @param {Object} [suite]
16971
17010
  */
16972
17011
  HTML.prototype.suiteURL = function (suite) {
16973
- return makeUrl(suite.fullTitle());
17012
+ return makeUrl('^' + escapeRe(suite.fullTitle()) + ' ');
16974
17013
  };
16975
17014
 
16976
17015
  /**
@@ -16979,7 +17018,7 @@
16979
17018
  * @param {Object} [test]
16980
17019
  */
16981
17020
  HTML.prototype.testURL = function (test) {
16982
- return makeUrl(test.fullTitle());
17021
+ return makeUrl('^' + escapeRe(test.fullTitle()) + '$');
16983
17022
  };
16984
17023
 
16985
17024
  /**
@@ -18561,7 +18600,7 @@
18561
18600
  * @param {Function} fn
18562
18601
  */
18563
18602
  before: function (name, fn) {
18564
- suites[0].beforeAll(name, fn);
18603
+ return suites[0].beforeAll(name, fn);
18565
18604
  },
18566
18605
 
18567
18606
  /**
@@ -18571,7 +18610,7 @@
18571
18610
  * @param {Function} fn
18572
18611
  */
18573
18612
  after: function (name, fn) {
18574
- suites[0].afterAll(name, fn);
18613
+ return suites[0].afterAll(name, fn);
18575
18614
  },
18576
18615
 
18577
18616
  /**
@@ -18581,7 +18620,7 @@
18581
18620
  * @param {Function} fn
18582
18621
  */
18583
18622
  beforeEach: function (name, fn) {
18584
- suites[0].beforeEach(name, fn);
18623
+ return suites[0].beforeEach(name, fn);
18585
18624
  },
18586
18625
 
18587
18626
  /**
@@ -18591,7 +18630,7 @@
18591
18630
  * @param {Function} fn
18592
18631
  */
18593
18632
  afterEach: function (name, fn) {
18594
- suites[0].afterEach(name, fn);
18633
+ return suites[0].afterEach(name, fn);
18595
18634
  },
18596
18635
 
18597
18636
  suite: {
@@ -19169,7 +19208,7 @@
19169
19208
  };
19170
19209
 
19171
19210
  var name = "mocha";
19172
- var version = "10.6.0";
19211
+ var version = "11.1.0";
19173
19212
  var homepage = "https://mochajs.org/";
19174
19213
  var notifyLogo = "https://ibin.co/4QuRuGjXvl36.png";
19175
19214
  var require$$17 = {
@@ -19338,6 +19377,7 @@
19338
19377
  * @param {boolean} [options.delay] - Delay root suite execution?
19339
19378
  * @param {boolean} [options.diff] - Show diff on failure?
19340
19379
  * @param {boolean} [options.dryRun] - Report tests without running them?
19380
+ * @param {boolean} [options.passOnFailingTestSuite] - Fail test run if tests were failed?
19341
19381
  * @param {boolean} [options.failZero] - Fail test run if zero tests?
19342
19382
  * @param {string} [options.fgrep] - Test filter given string.
19343
19383
  * @param {boolean} [options.forbidOnly] - Tests marked `only` fail the suite?
@@ -19374,7 +19414,9 @@
19374
19414
  .ui(options.ui)
19375
19415
  .reporter(
19376
19416
  options.reporter,
19377
- options.reporterOption || options.reporterOptions // for backwards compatibility
19417
+ options['reporter-option'] ||
19418
+ options.reporterOption ||
19419
+ options.reporterOptions // for backwards compatibility
19378
19420
  )
19379
19421
  .slow(options.slow)
19380
19422
  .global(options.global);
@@ -19397,6 +19439,7 @@
19397
19439
  'delay',
19398
19440
  'diff',
19399
19441
  'dryRun',
19442
+ 'passOnFailingTestSuite',
19400
19443
  'failZero',
19401
19444
  'forbidOnly',
19402
19445
  'forbidPending',
@@ -20051,6 +20094,20 @@
20051
20094
  return this;
20052
20095
  };
20053
20096
 
20097
+ /**
20098
+ * Fail test run if tests were failed.
20099
+ *
20100
+ * @public
20101
+ * @see [CLI option](../#-pass-on-failing-test-suite)
20102
+ * @param {boolean} [passOnFailingTestSuite=false] - Whether to fail test run.
20103
+ * @return {Mocha} this
20104
+ * @chainable
20105
+ */
20106
+ Mocha.prototype.passOnFailingTestSuite = function(passOnFailingTestSuite) {
20107
+ this.options.passOnFailingTestSuite = passOnFailingTestSuite === true;
20108
+ return this;
20109
+ };
20110
+
20054
20111
  /**
20055
20112
  * Causes tests marked `only` to fail the suite.
20056
20113
  *
@@ -20500,6 +20557,42 @@
20500
20557
  /* eslint no-unused-vars: off */
20501
20558
  /* eslint-env commonjs */
20502
20559
 
20560
+ // https://qiita.com/yamadashy/items/86702dfb3c572b4c5514
20561
+ const setZeroTimeout = (function(global) {
20562
+ const timeouts = [];
20563
+ const messageName = "zero-timeout-message";
20564
+
20565
+ if (typeof global === 'undefined') return;
20566
+
20567
+ function handleMessage(event) {
20568
+ if (event.source == global && event.data == messageName) {
20569
+ if (event.stopPropagation) {
20570
+ event.stopPropagation();
20571
+ }
20572
+ if (timeouts.length) {
20573
+ timeouts.shift()();
20574
+ }
20575
+ }
20576
+ }
20577
+
20578
+ if (global.postMessage) {
20579
+ if (global.addEventListener) {
20580
+ global.addEventListener("message", handleMessage, true);
20581
+ } else if (global.attachEvent) {
20582
+ global.attachEvent("onmessage", handleMessage);
20583
+ }
20584
+
20585
+ return function (fn) {
20586
+ timeouts.push(fn);
20587
+ global.postMessage(messageName, "*");
20588
+ }
20589
+ } else {
20590
+ return function () {
20591
+ setTimeout$1(fn, 0);
20592
+ }
20593
+ }
20594
+ }(window));
20595
+
20503
20596
  /**
20504
20597
  * Shim process.stdout.
20505
20598
  */
@@ -20597,7 +20690,7 @@
20597
20690
  immediateQueue.shift()();
20598
20691
  }
20599
20692
  if (immediateQueue.length) {
20600
- immediateTimeout = setTimeout$1(timeslice, 0);
20693
+ immediateTimeout = setZeroTimeout(timeslice);
20601
20694
  } else {
20602
20695
  immediateTimeout = null;
20603
20696
  }
@@ -20610,7 +20703,7 @@
20610
20703
  Mocha.Runner.immediately = function (callback) {
20611
20704
  immediateQueue.push(callback);
20612
20705
  if (!immediateTimeout) {
20613
- immediateTimeout = setTimeout$1(timeslice, 0);
20706
+ immediateTimeout = setZeroTimeout(timeslice);
20614
20707
  }
20615
20708
  };
20616
20709
 
@@ -3,11 +3,11 @@
3
3
  :root {
4
4
  --mocha-color: #000;
5
5
  --mocha-bg-color: #fff;
6
- --mocha-pass-icon-color: #00d6b2;
7
- --mocha-pass-color: #fff;
8
- --mocha-pass-shadow-color: rgba(0,0,0,.2);
9
- --mocha-pass-mediump-color: #c09853;
10
- --mocha-pass-slow-color: #b94a48;
6
+ --mocha-test-pass-color: #007f6a;
7
+ --mocha-test-pass-duration-color: #fff;
8
+ --mocha-test-pass-shadow-color: rgba(0,0,0, 0.2);
9
+ --mocha-test-pass-mediump-color: #c09853;
10
+ --mocha-test-pass-slow-color: #b94a48;
11
11
  --mocha-test-pending-color: #0b97c4;
12
12
  --mocha-test-pending-icon-color: #0b97c4;
13
13
  --mocha-test-fail-color: #c00;
@@ -38,11 +38,11 @@
38
38
  :root {
39
39
  --mocha-color: #fff;
40
40
  --mocha-bg-color: #222;
41
- --mocha-pass-icon-color: #00d6b2;
42
- --mocha-pass-color: #222;
43
- --mocha-pass-shadow-color: rgba(255,255,255,.2);
44
- --mocha-pass-mediump-color: #f1be67;
45
- --mocha-pass-slow-color: #f49896;
41
+ --mocha-test-pass-color: #00d6b2;
42
+ --mocha-test-pass-duration-color: #222;
43
+ --mocha-test-pass-shadow-color: rgba(255, 255, 255, 0.2);
44
+ --mocha-test-pass-mediump-color: #f1be67;
45
+ --mocha-test-pass-slow-color: #f49896;
46
46
  --mocha-test-pending-color: #0b97c4;
47
47
  --mocha-test-pending-icon-color: #0b97c4;
48
48
  --mocha-test-fail-color: #f44;
@@ -141,11 +141,11 @@ body {
141
141
  }
142
142
 
143
143
  #mocha .test.pass.medium .duration {
144
- background: var(--mocha-pass-mediump-color);
144
+ background: var(--mocha-test-pass-mediump-color);
145
145
  }
146
146
 
147
147
  #mocha .test.pass.slow .duration {
148
- background: var(--mocha-pass-slow-color);
148
+ background: var(--mocha-test-pass-slow-color);
149
149
  }
150
150
 
151
151
  #mocha .test.pass::before {
@@ -154,17 +154,17 @@ body {
154
154
  display: block;
155
155
  float: left;
156
156
  margin-right: 5px;
157
- color: var(--mocha-pass-icon-color);
157
+ color: var(--mocha-test-pass-color);
158
158
  }
159
159
 
160
160
  #mocha .test.pass .duration {
161
161
  font-size: 9px;
162
162
  margin-left: 5px;
163
163
  padding: 2px 5px;
164
- color: var(--mocha-pass-color);
165
- -webkit-box-shadow: inset 0 1px 1px var(--mocha-pass-shadow-color);
166
- -moz-box-shadow: inset 0 1px 1px var(--mocha-pass-shadow-color);
167
- box-shadow: inset 0 1px 1px var(--mocha-pass-shadow-color);
164
+ color: var(--mocha-test-pass-duration-color);
165
+ -webkit-box-shadow: inset 0 1px 1px var(--mocha-test-pass-shadow-color);
166
+ -moz-box-shadow: inset 0 1px 1px var(--mocha-test-pass-shadow-color);
167
+ box-shadow: inset 0 1px 1px var(--mocha-test-pass-shadow-color);
168
168
  -webkit-border-radius: 5px;
169
169
  -moz-border-radius: 5px;
170
170
  -ms-border-radius: 5px;
@@ -344,12 +344,37 @@ body {
344
344
  z-index: 1;
345
345
  }
346
346
 
347
+ #mocha-stats.fail li.result {
348
+ color: var(--mocha-test-fail-color);
349
+ }
350
+
351
+ #mocha-stats.fail li.failures {
352
+ color: var(--mocha-test-fail-color);
353
+ }
354
+
355
+ #mocha-stats.fail li.failures em {
356
+ color: var(--mocha-test-fail-color);
357
+ }
358
+
359
+ #mocha-stats.pass li.result {
360
+ color: var(--mocha-test-pass-color);
361
+ }
362
+
363
+ #mocha-stats.pass li.passes {
364
+ color: var(--mocha-test-pass-color);
365
+ }
366
+
367
+ #mocha-stats.pass li.passes em {
368
+ color: var(--mocha-test-pass-color);
369
+ }
370
+
347
371
  #mocha-stats .progress-contain {
348
372
  float: right;
349
373
  padding: 0;
350
374
  }
351
375
 
352
- #mocha-stats :is(.progress-element, .progress-text) {
376
+ #mocha-stats .progress-element,
377
+ #mocha-stats .progress-text {
353
378
  width: var(--ring-container-size);
354
379
  display: block;
355
380
  top: 12px;
@@ -374,7 +399,8 @@ body {
374
399
  height: var(--ring-container-size);
375
400
  }
376
401
 
377
- #mocha-stats :is(.ring-flatlight, .ring-highlight) {
402
+ #mocha-stats .ring-flatlight,
403
+ #mocha-stats .ring-highlight {
378
404
  --stroke-thickness: 1.65px;
379
405
  --center: calc(var(--ring-container-size) / 2);
380
406
  cx: var(--center);
metadata CHANGED
@@ -1,44 +1,30 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: importmap_mocha-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kato
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-15 00:00:00.000000000 Z
11
+ date: 2025-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: rails
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '7.0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '7.0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: importmap-rails
29
15
  requirement: !ruby/object:Gem::Requirement
30
16
  requirements:
31
17
  - - ">="
32
18
  - !ruby/object:Gem::Version
33
- version: '0'
19
+ version: 2.0.0
34
20
  type: :runtime
35
21
  prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
24
  - - ">="
39
25
  - !ruby/object:Gem::Version
40
- version: '0'
41
- description: Add JavaScript testing tools in importmap environment.
26
+ version: 2.0.0
27
+ description: Add JavaScript testing tools in importmap-rails environment.
42
28
  email:
43
29
  - tohosaku@users.osdn.me
44
30
  executables: []
@@ -59,22 +45,17 @@ files:
59
45
  - lib/tasks/importmap_mocha/rails_tasks.rake
60
46
  - vendor/javascripts/@mswjs--interceptors--presets--browser.js
61
47
  - vendor/javascripts/@mswjs--interceptors.js
62
- - vendor/javascripts/@open-draft--deferred-promise.js
63
- - vendor/javascripts/@open-draft--logger.js
64
- - vendor/javascripts/@open-draft--until.js
65
48
  - vendor/javascripts/chai.js
66
- - vendor/javascripts/is-node-process.js
67
49
  - vendor/javascripts/mocha.js
68
- - vendor/javascripts/outvariant.js
69
- - vendor/javascripts/strict-event-emitter.js
70
50
  - vendor/stylesheets/mocha.css
71
- homepage: https://github.com/tohosaku/importmap_mocha-rails
51
+ homepage: https://github.com/redmine-ui/importmap_mocha-rails
72
52
  licenses:
73
53
  - MIT
74
54
  metadata:
75
- homepage_uri: https://github.com/tohosaku/importmap_mocha-rails
76
- source_code_uri: https://github.com/tohosaku/importmap_mocha-rails
77
- changelog_uri: https://github.com/tohosaku/importmap_mocha-rails
55
+ rubygems_mfa_required: 'true'
56
+ homepage_uri: https://github.com/redmine-ui/importmap_mocha-rails
57
+ source_code_uri: https://github.com/redmine-ui/importmap_mocha-rails
58
+ changelog_uri: https://github.com/redmine-ui/importmap_mocha-rails
78
59
  post_install_message:
79
60
  rdoc_options: []
80
61
  require_paths:
@@ -1,2 +0,0 @@
1
- function createDeferredExecutor(){const executor=(e,t)=>{executor.state="pending";executor.resolve=t=>{if("pending"!==executor.state)return;executor.result=t;const onFulfilled=e=>{executor.state="fulfilled";return e};return e(t instanceof Promise?t:Promise.resolve(t).then(onFulfilled))};executor.reject=e=>{if("pending"===executor.state){queueMicrotask((()=>{executor.state="rejected"}));return t(executor.rejectionReason=e)}}};return executor}var e=class extends Promise{#e;resolve;reject;constructor(e=null){const t=createDeferredExecutor();super(((r,s)=>{t(r,s);e?.(t.resolve,t.reject)}));this.#e=t;this.resolve=this.#e.resolve;this.reject=this.#e.reject}get state(){return this.#e.state}get rejectionReason(){return this.#e.rejectionReason}then(e,t){return this.#t(super.then(e,t))}catch(e){return this.#t(super.catch(e))}finally(e){return this.#t(super.finally(e))}#t(e){return Object.defineProperties(e,{resolve:{configurable:true,value:this.resolve},reject:{configurable:true,value:this.reject}})}};export{e as DeferredPromise,createDeferredExecutor};
2
-
@@ -1,2 +0,0 @@
1
- import{isNodeProcess as e}from"is-node-process";import{format as r}from"outvariant";var t=Object.defineProperty;var __export=(e,r)=>{for(var i in r)t(e,i,{get:r[i],enumerable:true})};var i={};__export(i,{blue:()=>blue,gray:()=>gray,green:()=>green,red:()=>red,yellow:()=>yellow});function yellow(e){return`${e}`}function blue(e){return`${e}`}function gray(e){return`${e}`}function red(e){return`${e}`}function green(e){return`${e}`}var s=e();var n=class{constructor(e){this.name=e;this.prefix=`[${this.name}]`;const r=getVariable("DEBUG");const t=getVariable("LOG_LEVEL");const i="1"===r||"true"===r||"undefined"!==typeof r&&this.name.startsWith(r);if(i){this.debug=isDefinedAndNotEquals(t,"debug")?noop:this.debug;this.info=isDefinedAndNotEquals(t,"info")?noop:this.info;this.success=isDefinedAndNotEquals(t,"success")?noop:this.success;this.warning=isDefinedAndNotEquals(t,"warning")?noop:this.warning;this.error=isDefinedAndNotEquals(t,"error")?noop:this.error}else{this.info=noop;this.success=noop;this.warning=noop;this.error=noop;this.only=noop}}prefix;extend(e){return new n(`${this.name}:${e}`)}debug(e,...r){this.logEntry({level:"debug",message:gray(e),positionals:r,prefix:this.prefix,colors:{prefix:"gray"}})}info(e,...r){this.logEntry({level:"info",message:e,positionals:r,prefix:this.prefix,colors:{prefix:"blue"}});const t=new o;return(e,...r)=>{t.measure();this.logEntry({level:"info",message:`${e} ${gray(`${t.deltaTime}ms`)}`,positionals:r,prefix:this.prefix,colors:{prefix:"blue"}})}}success(e,...r){this.logEntry({level:"info",message:e,positionals:r,prefix:`✔ ${this.prefix}`,colors:{timestamp:"green",prefix:"green"}})}warning(e,...r){this.logEntry({level:"warning",message:e,positionals:r,prefix:`⚠ ${this.prefix}`,colors:{timestamp:"yellow",prefix:"yellow"}})}error(e,...r){this.logEntry({level:"error",message:e,positionals:r,prefix:`✖ ${this.prefix}`,colors:{timestamp:"red",prefix:"red"}})}only(e){e()}createEntry(e,r){return{timestamp:new Date,level:e,message:r}}logEntry(e){const{level:r,message:t,prefix:s,colors:n,positionals:o=[]}=e;const a=this.createEntry(r,t);const l=n?.timestamp||"gray";const c=n?.prefix||"gray";const f={timestamp:i[l],prefix:i[c]};const u=this.getWriter(r);u([f.timestamp(this.formatTimestamp(a.timestamp))].concat(null!=s?f.prefix(s):[]).concat(serializeInput(t)).join(" "),...o.map(serializeInput))}formatTimestamp(e){return`${e.toLocaleTimeString("en-GB")}:${e.getMilliseconds()}`}getWriter(e){switch(e){case"debug":case"success":case"info":return log;case"warning":return warn;case"error":return error}}};var o=class{startTime;endTime;deltaTime;constructor(){this.startTime=performance.now()}measure(){this.endTime=performance.now();const e=this.endTime-this.startTime;this.deltaTime=e.toFixed(2)}};var noop=()=>{};function log(e,...t){s?process.stdout.write(r(e,...t)+"\n"):console.log(e,...t)}function warn(e,...t){s?process.stderr.write(r(e,...t)+"\n"):console.warn(e,...t)}function error(e,...t){s?process.stderr.write(r(e,...t)+"\n"):console.error(e,...t)}function getVariable(e){return s?process.env[e]:globalThis[e]?.toString()}function isDefinedAndNotEquals(e,r){return void 0!==e&&e!==r}function serializeInput(e){return"undefined"===typeof e?"undefined":null===e?"null":"string"===typeof e?e:"object"===typeof e?JSON.stringify(e):e.toString()}export{n as Logger};
2
-
@@ -1,2 +0,0 @@
1
- var until=async r=>{try{const t=await r().catch((r=>{throw r}));return{error:null,data:t}}catch(r){return{error:r,data:null}}};export{until};
2
-
@@ -1,2 +0,0 @@
1
- function isNodeProcess(){if("undefined"!==typeof navigator&&"ReactNative"===navigator.product)return true;if("undefined"!==typeof process){const e=process.type;return"renderer"!==e&&"worker"!==e&&!!(process.versions&&process.versions.node)}return false}export{isNodeProcess};
2
-
@@ -1,2 +0,0 @@
1
- var t=/(%?)(%([sdjo]))/g;function serializePositional(t,r){switch(r){case"s":return t;case"d":case"i":return Number(t);case"j":return JSON.stringify(t);case"o":{if("string"===typeof t)return t;const r=JSON.stringify(t);return"{}"===r||"[]"===r||/^\[object .+?\]$/.test(r)?t:r}}}function format(r,...e){if(0===e.length)return r;let n=0;let s=r.replace(t,((t,r,s,a)=>{const i=e[n];const o=serializePositional(i,a);if(!r){n++;return o}return t}));n<e.length&&(s+=` ${e.slice(n).join(" ")}`);s=s.replace(/%{2,2}/g,"%");return s}var r=2;function cleanErrorStack(t){if(!t.stack)return;const e=t.stack.split("\n");e.splice(1,r);t.stack=e.join("\n")}var e=class extends Error{constructor(t,...r){super(t);this.message=t;this.name="Invariant Violation";this.message=format(t,...r);cleanErrorStack(this)}};var invariant=(t,r,...n)=>{if(!t)throw new e(r,...n)};invariant.as=(t,r,e,...n)=>{if(!r){const r=null!=t.prototype.name;const s=r?new t(format(e,n)):t(format(e,n));throw s}};export{e as InvariantError,format,invariant};
2
-
@@ -1,2 +0,0 @@
1
- var e=class extends Error{constructor(e,t,s){super(`Possible EventEmitter memory leak detected. ${s} ${t.toString()} listeners added. Use emitter.setMaxListeners() to increase limit`);this.emitter=e;this.type=t;this.count=s;this.name="MaxListenersExceededWarning"}};var t=class{static listenerCount(e,t){return e.listenerCount(t)}constructor(){this.events=new Map;this.maxListeners=t.defaultMaxListeners;this.hasWarnedAboutPotentialMemoryLeak=false}_emitInternalEvent(e,t,s){this.emit(e,t,s)}_getListeners(e){return Array.prototype.concat.apply([],this.events.get(e))||[]}_removeListener(e,t){const s=e.indexOf(t);s>-1&&e.splice(s,1);return[]}_wrapOnceListener(e,t){const onceListener=(...s)=>{this.removeListener(e,onceListener);return t.apply(this,s)};Object.defineProperty(onceListener,"name",{value:t.name});return onceListener}setMaxListeners(e){this.maxListeners=e;return this}getMaxListeners(){return this.maxListeners}eventNames(){return Array.from(this.events.keys())}emit(e,...t){const s=this._getListeners(e);s.forEach((e=>{e.apply(this,t)}));return s.length>0}addListener(t,s){this._emitInternalEvent("newListener",t,s);const r=this._getListeners(t).concat(s);this.events.set(t,r);if(this.maxListeners>0&&this.listenerCount(t)>this.maxListeners&&!this.hasWarnedAboutPotentialMemoryLeak){this.hasWarnedAboutPotentialMemoryLeak=true;const s=new e(this,t,this.listenerCount(t));console.warn(s)}return this}on(e,t){return this.addListener(e,t)}once(e,t){return this.addListener(e,this._wrapOnceListener(e,t))}prependListener(e,t){const s=this._getListeners(e);if(s.length>0){const r=[t].concat(s);this.events.set(e,r)}else this.events.set(e,s.concat(t));return this}prependOnceListener(e,t){return this.prependListener(e,this._wrapOnceListener(e,t))}removeListener(e,t){const s=this._getListeners(e);if(s.length>0){this._removeListener(s,t);this.events.set(e,s);this._emitInternalEvent("removeListener",e,t)}return this}off(e,t){return this.removeListener(e,t)}removeAllListeners(e){e?this.events.delete(e):this.events.clear();return this}listeners(e){return Array.from(this._getListeners(e))}listenerCount(e){return this._getListeners(e).length}rawListeners(e){return this.listeners(e)}};var s=t;s.defaultMaxListeners=10;export{s as Emitter,e as MemoryLeakError};
2
-