importmap_mocha-rails 0.3.1 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2 @@
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
+
@@ -0,0 +1,2 @@
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
+
@@ -0,0 +1,392 @@
1
+ @charset "utf-8";
2
+
3
+ :root {
4
+ --mocha-color: #000;
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;
11
+ --mocha-test-pending-color: #0b97c4;
12
+ --mocha-test-pending-icon-color: #0b97c4;
13
+ --mocha-test-fail-color: #c00;
14
+ --mocha-test-fail-icon-color: #c00;
15
+ --mocha-test-fail-pre-color: #000;
16
+ --mocha-test-fail-pre-error-color: #c00;
17
+ --mocha-test-html-error-color: #000;
18
+ --mocha-box-shadow-color: #eee;
19
+ --mocha-box-bottom-color: #ddd;
20
+ --mocha-test-replay-color: #000;
21
+ --mocha-test-replay-bg-color: #eee;
22
+ --mocha-stats-color: #888;
23
+ --mocha-stats-em-color: #000;
24
+ --mocha-stats-hover-color: #eee;
25
+ --mocha-error-color: #c00;
26
+
27
+ --mocha-code-comment: #ddd;
28
+ --mocha-code-init: #2f6fad;
29
+ --mocha-code-string: #5890ad;
30
+ --mocha-code-keyword: #8a6343;
31
+ --mocha-code-number: #2f6fad;
32
+ }
33
+
34
+ @media (prefers-color-scheme: dark) {
35
+ :root {
36
+ --mocha-color: #fff;
37
+ --mocha-bg-color: #222;
38
+ --mocha-pass-icon-color: #00d6b2;
39
+ --mocha-pass-color: #222;
40
+ --mocha-pass-shadow-color: rgba(255,255,255,.2);
41
+ --mocha-pass-mediump-color: #f1be67;
42
+ --mocha-pass-slow-color: #f49896;
43
+ --mocha-test-pending-color: #0b97c4;
44
+ --mocha-test-pending-icon-color: #0b97c4;
45
+ --mocha-test-fail-color: #f44;
46
+ --mocha-test-fail-icon-color: #f44;
47
+ --mocha-test-fail-pre-color: #fff;
48
+ --mocha-test-fail-pre-error-color: #f44;
49
+ --mocha-test-html-error-color: #fff;
50
+ --mocha-box-shadow-color: #444;
51
+ --mocha-box-bottom-color: #555;
52
+ --mocha-test-replay-color: #fff;
53
+ --mocha-test-replay-bg-color: #444;
54
+ --mocha-stats-color: #aaa;
55
+ --mocha-stats-em-color: #fff;
56
+ --mocha-stats-hover-color: #444;
57
+ --mocha-error-color: #f44;
58
+
59
+ --mocha-code-comment: #ddd;
60
+ --mocha-code-init: #9cc7f1;
61
+ --mocha-code-string: #80d4ff;
62
+ --mocha-code-keyword: #e3a470;
63
+ --mocha-code-number: #4ca7ff;
64
+ }
65
+ }
66
+
67
+ body {
68
+ margin:0;
69
+ background-color: var(--mocha-bg-color);
70
+ color: var(--mocha-color);
71
+ }
72
+
73
+ #mocha {
74
+ font: 20px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
75
+ margin: 60px 50px;
76
+ }
77
+
78
+ #mocha ul,
79
+ #mocha li {
80
+ margin: 0;
81
+ padding: 0;
82
+ }
83
+
84
+ #mocha ul {
85
+ list-style: none;
86
+ }
87
+
88
+ #mocha h1,
89
+ #mocha h2 {
90
+ margin: 0;
91
+ }
92
+
93
+ #mocha h1 {
94
+ margin-top: 15px;
95
+ font-size: 1em;
96
+ font-weight: 200;
97
+ }
98
+
99
+ #mocha h1 a {
100
+ text-decoration: none;
101
+ color: inherit;
102
+ }
103
+
104
+ #mocha h1 a:hover {
105
+ text-decoration: underline;
106
+ }
107
+
108
+ #mocha .suite .suite h1 {
109
+ margin-top: 0;
110
+ font-size: .8em;
111
+ }
112
+
113
+ #mocha .hidden {
114
+ display: none;
115
+ }
116
+
117
+ #mocha h2 {
118
+ font-size: 12px;
119
+ font-weight: normal;
120
+ cursor: pointer;
121
+ }
122
+
123
+ #mocha .suite {
124
+ margin-left: 15px;
125
+ }
126
+
127
+ #mocha .test {
128
+ margin-left: 15px;
129
+ overflow: hidden;
130
+ }
131
+
132
+ #mocha .test.pending:hover h2::after {
133
+ content: '(pending)';
134
+ font-family: arial, sans-serif;
135
+ }
136
+
137
+ #mocha .test.pass.medium .duration {
138
+ background: var(--mocha-pass-mediump-color);
139
+ }
140
+
141
+ #mocha .test.pass.slow .duration {
142
+ background: var(--mocha-pass-slow-color);
143
+ }
144
+
145
+ #mocha .test.pass::before {
146
+ content: '✓';
147
+ font-size: 12px;
148
+ display: block;
149
+ float: left;
150
+ margin-right: 5px;
151
+ color: var(--mocha-pass-icon-color);
152
+ }
153
+
154
+ #mocha .test.pass .duration {
155
+ font-size: 9px;
156
+ margin-left: 5px;
157
+ padding: 2px 5px;
158
+ color: var(--mocha-pass-color);
159
+ -webkit-box-shadow: inset 0 1px 1px var(--mocha-pass-shadow-color);
160
+ -moz-box-shadow: inset 0 1px 1px var(--mocha-pass-shadow-color);
161
+ box-shadow: inset 0 1px 1px var(--mocha-pass-shadow-color);
162
+ -webkit-border-radius: 5px;
163
+ -moz-border-radius: 5px;
164
+ -ms-border-radius: 5px;
165
+ -o-border-radius: 5px;
166
+ border-radius: 5px;
167
+ }
168
+
169
+ #mocha .test.pass.fast .duration {
170
+ display: none;
171
+ }
172
+
173
+ #mocha .test.pending {
174
+ color: var(--mocha-test-pending-color);
175
+ }
176
+
177
+ #mocha .test.pending::before {
178
+ content: '◦';
179
+ color: var(--mocha-test-pending-icon-color);
180
+ }
181
+
182
+ #mocha .test.fail {
183
+ color: var(--mocha-test-fail-color);
184
+ }
185
+
186
+ #mocha .test.fail pre {
187
+ color: var(--mocha-test-fail-pre-color);
188
+ }
189
+
190
+ #mocha .test.fail::before {
191
+ content: '✖';
192
+ font-size: 12px;
193
+ display: block;
194
+ float: left;
195
+ margin-right: 5px;
196
+ color: var(--mocha-test-fail-icon-color);
197
+ }
198
+
199
+ #mocha .test pre.error {
200
+ color: var(--mocha-test-fail-pre-error-color);
201
+ max-height: 300px;
202
+ overflow: auto;
203
+ }
204
+
205
+ #mocha .test .html-error {
206
+ overflow: auto;
207
+ color: var(--mocha-test-html-error-color);
208
+ display: block;
209
+ float: left;
210
+ clear: left;
211
+ font: 12px/1.5 monaco, monospace;
212
+ margin: 5px;
213
+ padding: 15px;
214
+ border: 1px solid var(--mocha-box-shadow-color);
215
+ max-width: 85%; /*(1)*/
216
+ max-width: -webkit-calc(100% - 42px);
217
+ max-width: -moz-calc(100% - 42px);
218
+ max-width: calc(100% - 42px); /*(2)*/
219
+ max-height: 300px;
220
+ word-wrap: break-word;
221
+ border-bottom-color: var(--mocha-box-bottom-color);
222
+ -webkit-box-shadow: 0 1px 3px var(--mocha-box-shadow-color);
223
+ -moz-box-shadow: 0 1px 3px var(--mocha-box-shadow-color);
224
+ box-shadow: 0 1px 3px var(--mocha-box-shadow-color);
225
+ -webkit-border-radius: 3px;
226
+ -moz-border-radius: 3px;
227
+ border-radius: 3px;
228
+ }
229
+
230
+ #mocha .test .html-error pre.error {
231
+ border: none;
232
+ -webkit-border-radius: 0;
233
+ -moz-border-radius: 0;
234
+ border-radius: 0;
235
+ -webkit-box-shadow: 0;
236
+ -moz-box-shadow: 0;
237
+ box-shadow: 0;
238
+ padding: 0;
239
+ margin: 0;
240
+ margin-top: 18px;
241
+ max-height: none;
242
+ }
243
+
244
+ /**
245
+ * (1): approximate for browsers not supporting calc
246
+ * (2): 42 = 2*15 + 2*10 + 2*1 (padding + margin + border)
247
+ * ^^ seriously
248
+ */
249
+ #mocha .test pre {
250
+ display: block;
251
+ float: left;
252
+ clear: left;
253
+ font: 12px/1.5 monaco, monospace;
254
+ margin: 5px;
255
+ padding: 15px;
256
+ border: 1px solid var(--mocha-box-shadow-color);
257
+ max-width: 85%; /*(1)*/
258
+ max-width: -webkit-calc(100% - 42px);
259
+ max-width: -moz-calc(100% - 42px);
260
+ max-width: calc(100% - 42px); /*(2)*/
261
+ word-wrap: break-word;
262
+ border-bottom-color: var(--mocha-box-bottom-color);
263
+ -webkit-box-shadow: 0 1px 3px var(--mocha-box-shadow-color);
264
+ -moz-box-shadow: 0 1px 3px var(--mocha-box-shadow-color);
265
+ box-shadow: 0 1px 3px var(--mocha-box-shadow-color);
266
+ -webkit-border-radius: 3px;
267
+ -moz-border-radius: 3px;
268
+ border-radius: 3px;
269
+ }
270
+
271
+ #mocha .test h2 {
272
+ position: relative;
273
+ }
274
+
275
+ #mocha .test a.replay {
276
+ position: absolute;
277
+ top: 3px;
278
+ right: 0;
279
+ text-decoration: none;
280
+ vertical-align: middle;
281
+ display: block;
282
+ width: 15px;
283
+ height: 15px;
284
+ line-height: 15px;
285
+ text-align: center;
286
+ background: var(--mocha-test-replay-bg-color);
287
+ font-size: 15px;
288
+ -webkit-border-radius: 15px;
289
+ -moz-border-radius: 15px;
290
+ border-radius: 15px;
291
+ -webkit-transition:opacity 200ms;
292
+ -moz-transition:opacity 200ms;
293
+ -o-transition:opacity 200ms;
294
+ transition: opacity 200ms;
295
+ opacity: 0.7;
296
+ color: var(--mocha-test-replay-color);
297
+ }
298
+
299
+ #mocha .test:hover a.replay {
300
+ box-shadow: 0 0 1px inset var(--mocha-test-replay-color);
301
+ opacity: 1;
302
+ }
303
+
304
+ #mocha-report.pass .test.fail {
305
+ display: none;
306
+ }
307
+
308
+ #mocha-report.fail .test.pass {
309
+ display: none;
310
+ }
311
+
312
+ #mocha-report.pending .test.pass,
313
+ #mocha-report.pending .test.fail {
314
+ display: none;
315
+ }
316
+ #mocha-report.pending .test.pass.pending {
317
+ display: block;
318
+ }
319
+
320
+ #mocha-error {
321
+ color: var(--mocha-error-color);
322
+ font-size: 1.5em;
323
+ font-weight: 100;
324
+ letter-spacing: 1px;
325
+ }
326
+
327
+ #mocha-stats {
328
+ position: fixed;
329
+ top: 15px;
330
+ right: 10px;
331
+ font-size: 12px;
332
+ margin: 0;
333
+ color: var(--mocha-stats-color);
334
+ z-index: 1;
335
+ }
336
+
337
+ #mocha-stats .progress {
338
+ float: right;
339
+ padding-top: 0;
340
+
341
+ /**
342
+ * Set safe initial values, so mochas .progress does not inherit these
343
+ * properties from Bootstrap .progress (which causes .progress height to
344
+ * equal line height set in Bootstrap).
345
+ */
346
+ height: auto;
347
+ -webkit-box-shadow: none;
348
+ -moz-box-shadow: none;
349
+ box-shadow: none;
350
+ background-color: initial;
351
+ }
352
+
353
+ #mocha-stats em {
354
+ color: var(--mocha-stats-em-color);
355
+ }
356
+
357
+ #mocha-stats a {
358
+ text-decoration: none;
359
+ color: inherit;
360
+ }
361
+
362
+ #mocha-stats a:hover {
363
+ border-bottom: 1px solid var(--mocha-stats-hover-color);
364
+ }
365
+
366
+ #mocha-stats li {
367
+ display: inline-block;
368
+ margin: 0 5px;
369
+ list-style: none;
370
+ padding-top: 11px;
371
+ }
372
+
373
+ #mocha-stats canvas {
374
+ width: 40px;
375
+ height: 40px;
376
+ }
377
+
378
+ #mocha code .comment { color: var(--mocha-code-comment); }
379
+ #mocha code .init { color: var(--mocha-code-init); }
380
+ #mocha code .string { color: var(--mocha-code-string); }
381
+ #mocha code .keyword { color: var(--mocha-code-keyword); }
382
+ #mocha code .number { color: var(--mocha-code-number); }
383
+
384
+ @media screen and (max-device-width: 480px) {
385
+ #mocha {
386
+ margin: 60px 0px;
387
+ }
388
+
389
+ #mocha #stats {
390
+ position: absolute;
391
+ }
392
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: importmap_mocha-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.3
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-01-17 00:00:00.000000000 Z
11
+ date: 2024-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -52,6 +52,22 @@ files:
52
52
  - app/controllers/importmap_mocha/test_controller.rb
53
53
  - app/helpers/importmap_mocha/test_helper.rb
54
54
  - app/views/importmap_mocha/test/index.html.erb
55
+ - config/importmap.rb
56
+ - lib/importmap_mocha-rails.rb
57
+ - lib/importmap_mocha/engine.rb
58
+ - lib/importmap_mocha/version.rb
59
+ - lib/tasks/importmap_mocha/rails_tasks.rake
60
+ - vendor/javascripts/@mswjs--interceptors--presets--browser.js
61
+ - 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
+ - vendor/javascripts/chai.js
66
+ - vendor/javascripts/is-node-process.js
67
+ - vendor/javascripts/mocha.js
68
+ - vendor/javascripts/outvariant.js
69
+ - vendor/javascripts/strict-event-emitter.js
70
+ - vendor/stylesheets/mocha.css
55
71
  homepage: https://github.com/tohosaku/importmap_mocha-rails
56
72
  licenses:
57
73
  - MIT