squint-cljs 0.14.197 → 0.14.198

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.
@@ -4,9 +4,9 @@ import * as clojure_DOT_string from 'squint-cljs/src/squint/string.js';
4
4
  var _STAR_current_env_STAR_ = ({val: null});
5
5
  var _STAR_current_reporter_STAR_ = ({val: "cljs.test/default"});
6
6
  var current_reporter = function () {
7
- const or__23674__auto__1 = _STAR_current_reporter_STAR_.val;
8
- if (squint_core.truth_(or__23674__auto__1)) {
9
- return or__23674__auto__1} else {
7
+ const or__23653__auto__1 = _STAR_current_reporter_STAR_.val;
8
+ if (squint_core.truth_(or__23653__auto__1)) {
9
+ return or__23653__auto__1} else {
10
10
  return "cljs.test/default"};
11
11
 
12
12
  };
@@ -15,9 +15,9 @@ return ({"report-counters": ({"test": 0, "pass": 0, "fail": 0, "error": 0}), "te
15
15
 
16
16
  };
17
17
  var get_current_env = function () {
18
- const or__23674__auto__1 = _STAR_current_env_STAR_.val;
19
- if (squint_core.truth_(or__23674__auto__1)) {
20
- return or__23674__auto__1} else {
18
+ const or__23653__auto__1 = _STAR_current_env_STAR_.val;
19
+ if (squint_core.truth_(or__23653__auto__1)) {
20
+ return or__23653__auto__1} else {
21
21
  return empty_env()};
22
22
 
23
23
  };
@@ -32,32 +32,32 @@ return null;
32
32
 
33
33
  };
34
34
  var update_current_env_BANG_ = /* @__PURE__ */ (() => {
35
- const impl31 = (function (ks, f, args) {
35
+ const impl51 = (function (ks, f, args) {
36
36
  const env2 = get_current_env();
37
37
  const new_env3 = squint_core.apply(squint_core.update_in, env2, ks, f, args);
38
38
  return set_env_BANG_(new_env3);
39
39
 
40
40
  });
41
- const f1 = (function (ks, f, ...rest2) {
42
- return impl31(ks, f, (((rest2.length === 0)) ? (null) : (rest2)));
41
+ const f1 = (function (arg2, arg3, ...rest4) {
42
+ return impl51(arg2, arg3, (((rest4.length === 0)) ? (null) : (rest4)));
43
43
 
44
44
  });
45
- (f1["squint$lang$variadic"] = impl31);
45
+ (f1["squint$lang$variadic"] = impl51);
46
46
  return f1;
47
47
 
48
48
  })();
49
49
  var testing_contexts_str = function () {
50
- const temp__23300__auto__1 = squint_core.seq(squint_core.get(get_current_env(), "testing-contexts"));
51
- if (squint_core.truth_(temp__23300__auto__1)) {
52
- const contexts2 = temp__23300__auto__1;
50
+ const temp__23234__auto__1 = squint_core.seq(squint_core.get(get_current_env(), "testing-contexts"));
51
+ if (squint_core.truth_(temp__23234__auto__1)) {
52
+ const contexts2 = temp__23234__auto__1;
53
53
  return clojure_DOT_string.join(" ", squint_core.reverse(contexts2));
54
54
  };
55
55
 
56
56
  };
57
57
  var testing_vars_str = function () {
58
- const temp__23300__auto__1 = squint_core.seq(squint_core.get(get_current_env(), "testing-vars"));
59
- if (squint_core.truth_(temp__23300__auto__1)) {
60
- const vars2 = temp__23300__auto__1;
58
+ const temp__23234__auto__1 = squint_core.seq(squint_core.get(get_current_env(), "testing-vars"));
59
+ if (squint_core.truth_(temp__23234__auto__1)) {
60
+ const vars2 = temp__23234__auto__1;
61
61
  return clojure_DOT_string.join(" ", squint_core.map(squint_core.str, vars2));
62
62
  };
63
63
 
@@ -72,10 +72,10 @@ var current_test_str = function () {
72
72
  const vars1 = testing_vars_str();
73
73
  const ctx2 = testing_contexts_str();
74
74
  if (squint_core.truth_((() => {
75
- const and__23699__auto__3 = vars1;
76
- if (squint_core.truth_(and__23699__auto__3)) {
75
+ const and__23692__auto__3 = vars1;
76
+ if (squint_core.truth_(and__23692__auto__3)) {
77
77
  return ctx2} else {
78
- return and__23699__auto__3};
78
+ return and__23692__auto__3};
79
79
 
80
80
  })())) {
81
81
  return `${vars1??''}${" "}${ctx2??''}`} else {
@@ -88,18 +88,18 @@ return "test"} else {
88
88
  return null}}}};
89
89
 
90
90
  };
91
- var report_loc = function (p__4) {
92
- const map__12 = p__4;
91
+ var report_loc = function (p__6) {
92
+ const map__12 = p__6;
93
93
  const line3 = squint_core.get(map__12, "line");
94
94
  const column4 = squint_core.get(map__12, "column");
95
95
  const file5 = squint_core.get(map__12, "file");
96
96
  if (squint_core.truth_((() => {
97
- const or__23674__auto__6 = line3;
98
- if (squint_core.truth_(or__23674__auto__6)) {
99
- return or__23674__auto__6} else {
100
- const or__23674__auto__7 = column4;
101
- if (squint_core.truth_(or__23674__auto__7)) {
102
- return or__23674__auto__7} else {
97
+ const or__23653__auto__6 = line3;
98
+ if (squint_core.truth_(or__23653__auto__6)) {
99
+ return or__23653__auto__6} else {
100
+ const or__23653__auto__7 = column4;
101
+ if (squint_core.truth_(or__23653__auto__7)) {
102
+ return or__23653__auto__7} else {
103
103
  return file5};
104
104
  };
105
105
 
@@ -122,39 +122,39 @@ return inc_report_counter_BANG_("pass");
122
122
  }));
123
123
  squint_multi.defmethod(report, ["cljs.test/default", "fail"], (function (m) {
124
124
  inc_report_counter_BANG_("fail");
125
- console.error(`${"FAIL in "}${current_test_str()??''}${(() => {
126
- const temp__23300__auto__1 = report_loc(m);
127
- if (squint_core.truth_(temp__23300__auto__1)) {
128
- const l2 = temp__23300__auto__1;
125
+ squint_core.println(`${"FAIL in "}${current_test_str()??''}${(() => {
126
+ const temp__23234__auto__1 = report_loc(m);
127
+ if (squint_core.truth_(temp__23234__auto__1)) {
128
+ const l2 = temp__23234__auto__1;
129
129
  return `${" ("}${l2??''}${")"}`;
130
130
  };
131
131
 
132
132
  })()??''}`);
133
133
  if (squint_core.truth_(squint_core.get(m, "message"))) {
134
- console.error(" ", squint_core.get(m, "message"))};
135
- console.error(" expected:", squint_core.pr_str(squint_core.get(m, "expected")));
136
- return console.error(" actual:", squint_core.pr_str(squint_core.get(m, "actual")));
134
+ squint_core.println(" ", squint_core.get(m, "message"))};
135
+ squint_core.println(" expected:", squint_core.pr_str(squint_core.get(m, "expected")));
136
+ return squint_core.println(" actual:", squint_core.pr_str(squint_core.get(m, "actual")));
137
137
 
138
138
  }));
139
139
  squint_multi.defmethod(report, ["cljs.test/default", "error"], (function (m) {
140
140
  inc_report_counter_BANG_("error");
141
- console.error(`${"ERROR in "}${current_test_str()??''}${(() => {
142
- const temp__23300__auto__1 = report_loc(m);
143
- if (squint_core.truth_(temp__23300__auto__1)) {
144
- const l2 = temp__23300__auto__1;
141
+ squint_core.println(`${"ERROR in "}${current_test_str()??''}${(() => {
142
+ const temp__23234__auto__1 = report_loc(m);
143
+ if (squint_core.truth_(temp__23234__auto__1)) {
144
+ const l2 = temp__23234__auto__1;
145
145
  return `${" ("}${l2??''}${")"}`;
146
146
  };
147
147
 
148
148
  })()??''}`);
149
149
  if (squint_core.truth_(squint_core.get(m, "message"))) {
150
- console.error(" ", squint_core.get(m, "message"))};
150
+ squint_core.println(" ", squint_core.get(m, "message"))};
151
151
  if (squint_core.truth_(squint_core.get(m, "expected"))) {
152
- console.error(" expected:", squint_core.pr_str(squint_core.get(m, "expected")))};
153
- return console.error(" actual:", squint_core.pr_str(squint_core.get(m, "actual")));
152
+ squint_core.println(" expected:", squint_core.pr_str(squint_core.get(m, "expected")))};
153
+ return squint_core.println(" actual:", squint_core.pr_str(squint_core.get(m, "actual")));
154
154
 
155
155
  }));
156
156
  squint_multi.defmethod(report, ["cljs.test/default", "begin-test-ns"], (function (m) {
157
- return console.log("\nTesting", `${squint_core.get(m, "ns")??''}`);
157
+ return squint_core.println("\nTesting", `${squint_core.get(m, "ns")??''}`);
158
158
 
159
159
  }));
160
160
  squint_multi.defmethod(report, ["cljs.test/default", "end-test-ns"], (function (_) {
@@ -170,13 +170,13 @@ return null;
170
170
 
171
171
  }));
172
172
  squint_multi.defmethod(report, ["cljs.test/default", "summary"], (function (_) {
173
- let map__15 = squint_core.get(get_current_env(), "report-counters");
174
- let test6 = squint_core.get(map__15, "test");
175
- let pass7 = squint_core.get(map__15, "pass");
176
- let fail8 = squint_core.get(map__15, "fail");
177
- let error9 = squint_core.get(map__15, "error");
178
- console.log("\nRan", test6, "tests containing", (pass7 + fail8 + error9), "assertions.");
179
- return console.log(`${fail8??''}`, "failures,", `${error9??''}`, "errors.");
173
+ let map__17 = squint_core.get(get_current_env(), "report-counters");
174
+ let test8 = squint_core.get(map__17, "test");
175
+ let pass9 = squint_core.get(map__17, "pass");
176
+ let fail10 = squint_core.get(map__17, "fail");
177
+ let error11 = squint_core.get(map__17, "error");
178
+ squint_core.println("\nRan", test8, "tests containing", (pass9 + fail10 + error11), "assertions.");
179
+ return squint_core.println(`${fail10??''}`, "failures,", `${error11??''}`, "errors.");
180
180
 
181
181
  }));
182
182
  var successful_QMARK_ = function (results) {
@@ -184,10 +184,10 @@ return ((squint_core.get(results, "fail", 0) === 0) && (squint_core.get(results,
184
184
 
185
185
  };
186
186
  var async_QMARK_ = function (x) {
187
- const c__23603__auto__1 = Promise;
188
- const x__23604__auto__2 = x;
189
- const ret__23605__auto__3 = (x__23604__auto__2 instanceof c__23603__auto__1);
190
- return ret__23605__auto__3;
187
+ const c__23598__auto__1 = Promise;
188
+ const x__23599__auto__2 = x;
189
+ const ret__23600__auto__3 = (x__23599__auto__2 instanceof c__23598__auto__1);
190
+ return ret__23600__auto__3;
191
191
 
192
192
  };
193
193
  var wrap_async = function (setup, teardown) {
@@ -221,119 +221,115 @@ return f();
221
221
 
222
222
  };
223
223
  var get_each_fixtures = /* @__PURE__ */ (() => {
224
- const f10 = (function (...args11) {
225
- const G__121 = args11.length;
226
- switch (G__121) {case 0:
227
- return f10.cljs$core$IFn$_invoke$arity$0();
228
-
229
- break;
230
- case 1:
231
- return f10.cljs$core$IFn$_invoke$arity$1(args11[0]);
232
-
233
- break;
234
- default:
235
- throw (new Error(`${"Invalid arity: "}${args11.length??''}`))};
236
-
237
- });
238
- f10.cljs$core$IFn$_invoke$arity$0 = (function () {
224
+ const impl151 = (function () {
239
225
  return get_each_fixtures(null);
240
226
 
241
227
  });
242
- f10.cljs$core$IFn$_invoke$arity$1 = (function (ns_str) {
228
+ const impl162 = (function (ns_str) {
243
229
  return squint_core.get_in(get_current_env(), ["each-fixtures", ns_str], []);
244
230
 
245
231
  });
246
- f10.cljs$lang$maxFixedArity = 1;
247
- return f10;
248
-
249
- })();
250
- var set_each_fixtures_BANG_ = /* @__PURE__ */ (() => {
251
- const f13 = (function (...args14) {
252
- const G__151 = args14.length;
253
- switch (G__151) {case 1:
254
- return f13.cljs$core$IFn$_invoke$arity$1(args14[0]);
232
+ const f12 = (function (...args13) {
233
+ const G__173 = args13.length;
234
+ switch (G__173) {case 0:
235
+ return impl151();
255
236
 
256
237
  break;
257
- case 2:
258
- return f13.cljs$core$IFn$_invoke$arity$2(args14[0], args14[1]);
238
+ case 1:
239
+ return impl162(args13[0]);
259
240
 
260
241
  break;
261
242
  default:
262
- throw (new Error(`${"Invalid arity: "}${args14.length??''}`))};
243
+ throw (new Error(`${"Invalid arity: "}${args13.length??''}`))};
263
244
 
264
245
  });
265
- f13.cljs$core$IFn$_invoke$arity$1 = (function (fixtures) {
246
+ return f12;
247
+
248
+ })();
249
+ var set_each_fixtures_BANG_ = /* @__PURE__ */ (() => {
250
+ const impl211 = (function (fixtures) {
266
251
  return set_each_fixtures_BANG_(null, fixtures);
267
252
 
268
253
  });
269
- f13.cljs$core$IFn$_invoke$arity$2 = (function (ns_str, fixtures) {
254
+ const impl222 = (function (ns_str, fixtures) {
270
255
  return update_current_env_BANG_(["each-fixtures", ns_str], squint_core.constantly(fixtures));
271
256
 
272
257
  });
273
- f13.cljs$lang$maxFixedArity = 2;
274
- return f13;
275
-
276
- })();
277
- var get_once_fixtures = /* @__PURE__ */ (() => {
278
- const f16 = (function (...args17) {
279
- const G__181 = args17.length;
280
- switch (G__181) {case 0:
281
- return f16.cljs$core$IFn$_invoke$arity$0();
258
+ const f18 = (function (...args19) {
259
+ const G__233 = args19.length;
260
+ switch (G__233) {case 1:
261
+ return impl211(args19[0]);
282
262
 
283
263
  break;
284
- case 1:
285
- return f16.cljs$core$IFn$_invoke$arity$1(args17[0]);
264
+ case 2:
265
+ return impl222(args19[0], args19[1]);
286
266
 
287
267
  break;
288
268
  default:
289
- throw (new Error(`${"Invalid arity: "}${args17.length??''}`))};
269
+ throw (new Error(`${"Invalid arity: "}${args19.length??''}`))};
290
270
 
291
271
  });
292
- f16.cljs$core$IFn$_invoke$arity$0 = (function () {
272
+ return f18;
273
+
274
+ })();
275
+ var get_once_fixtures = /* @__PURE__ */ (() => {
276
+ const impl271 = (function () {
293
277
  return get_once_fixtures(null);
294
278
 
295
279
  });
296
- f16.cljs$core$IFn$_invoke$arity$1 = (function (ns_str) {
280
+ const impl282 = (function (ns_str) {
297
281
  return squint_core.get_in(get_current_env(), ["once-fixtures", ns_str], []);
298
282
 
299
283
  });
300
- f16.cljs$lang$maxFixedArity = 1;
301
- return f16;
302
-
303
- })();
304
- var set_once_fixtures_BANG_ = /* @__PURE__ */ (() => {
305
- const f19 = (function (...args20) {
306
- const G__211 = args20.length;
307
- switch (G__211) {case 1:
308
- return f19.cljs$core$IFn$_invoke$arity$1(args20[0]);
284
+ const f24 = (function (...args25) {
285
+ const G__293 = args25.length;
286
+ switch (G__293) {case 0:
287
+ return impl271();
309
288
 
310
289
  break;
311
- case 2:
312
- return f19.cljs$core$IFn$_invoke$arity$2(args20[0], args20[1]);
290
+ case 1:
291
+ return impl282(args25[0]);
313
292
 
314
293
  break;
315
294
  default:
316
- throw (new Error(`${"Invalid arity: "}${args20.length??''}`))};
295
+ throw (new Error(`${"Invalid arity: "}${args25.length??''}`))};
317
296
 
318
297
  });
319
- f19.cljs$core$IFn$_invoke$arity$1 = (function (fixtures) {
298
+ return f24;
299
+
300
+ })();
301
+ var set_once_fixtures_BANG_ = /* @__PURE__ */ (() => {
302
+ const impl331 = (function (fixtures) {
320
303
  return set_once_fixtures_BANG_(null, fixtures);
321
304
 
322
305
  });
323
- f19.cljs$core$IFn$_invoke$arity$2 = (function (ns_str, fixtures) {
306
+ const impl342 = (function (ns_str, fixtures) {
324
307
  return update_current_env_BANG_(["once-fixtures", ns_str], squint_core.constantly(fixtures));
325
308
 
326
309
  });
327
- f19.cljs$lang$maxFixedArity = 2;
328
- return f19;
310
+ const f30 = (function (...args31) {
311
+ const G__353 = args31.length;
312
+ switch (G__353) {case 1:
313
+ return impl331(args31[0]);
314
+
315
+ break;
316
+ case 2:
317
+ return impl342(args31[0], args31[1]);
318
+
319
+ break;
320
+ default:
321
+ throw (new Error(`${"Invalid arity: "}${args31.length??''}`))};
322
+
323
+ });
324
+ return f30;
329
325
 
330
326
  })();
331
327
  var test_var = function (v) {
332
328
  if (squint_core.truth_(squint_core.fn_QMARK_(v))) {
333
329
  const test_name1 = (() => {
334
- const or__23674__auto__2 = squint_core.get(squint_core.meta(v), "name");
335
- if (squint_core.truth_(or__23674__auto__2)) {
336
- return or__23674__auto__2} else {
330
+ const or__23653__auto__2 = squint_core.get(squint_core.meta(v), "name");
331
+ if (squint_core.truth_(or__23653__auto__2)) {
332
+ return or__23653__auto__2} else {
337
333
  return "anonymous"};
338
334
 
339
335
  })();
@@ -391,30 +387,29 @@ return test_fn;
391
387
 
392
388
  };
393
389
  var registered_tests = /* @__PURE__ */ (() => {
394
- const f22 = (function (...args23) {
395
- const G__241 = args23.length;
396
- switch (G__241) {case 0:
397
- return f22.cljs$core$IFn$_invoke$arity$0();
390
+ const impl391 = (function () {
391
+ return squint_core.vec(squint_core.mapcat(squint_core.vals, squint_core.vals(squint_core.deref(test_registry))));
392
+
393
+ });
394
+ const impl402 = (function (ns_str) {
395
+ return squint_core.vec(squint_core.vals(squint_core.get(squint_core.deref(test_registry), ns_str)));
396
+
397
+ });
398
+ const f36 = (function (...args37) {
399
+ const G__413 = args37.length;
400
+ switch (G__413) {case 0:
401
+ return impl391();
398
402
 
399
403
  break;
400
404
  case 1:
401
- return f22.cljs$core$IFn$_invoke$arity$1(args23[0]);
405
+ return impl402(args37[0]);
402
406
 
403
407
  break;
404
408
  default:
405
- throw (new Error(`${"Invalid arity: "}${args23.length??''}`))};
406
-
407
- });
408
- f22.cljs$core$IFn$_invoke$arity$0 = (function () {
409
- return squint_core.vec(squint_core.mapcat(squint_core.vals, squint_core.vals(squint_core.deref(test_registry))));
410
-
411
- });
412
- f22.cljs$core$IFn$_invoke$arity$1 = (function (ns_str) {
413
- return squint_core.vec(squint_core.vals(squint_core.get(squint_core.deref(test_registry), ns_str)));
409
+ throw (new Error(`${"Invalid arity: "}${args37.length??''}`))};
414
410
 
415
411
  });
416
- f22.cljs$lang$maxFixedArity = 1;
417
- return f22;
412
+ return f36;
418
413
 
419
414
  })();
420
415
  var run_vars_with_once_fixtures = function (ns_str, vars) {
@@ -454,7 +449,7 @@ return finish6(chain5)};
454
449
  };
455
450
  var fresh_counters = ({"test": 0, "pass": 0, "fail": 0, "error": 0});
456
451
  var run_tests = /* @__PURE__ */ (() => {
457
- const impl271 = (function (args) {
452
+ const impl441 = (function (args) {
458
453
  const test_vars2 = ((squint_core.truth_(squint_core.empty_QMARK_(args))) ? (registered_tests()) : (((squint_core.truth_(squint_core.string_QMARK_(squint_core.first(args)))) ? (squint_core.vec(squint_core.mapcat(registered_tests, args))) : ((("else") ? (args) : (null))))));
459
454
  const _3 = (((_STAR_current_env_STAR_.val == null)) ? (set_env_BANG_(empty_env())) : (null));
460
455
  const saved_counters4 = squint_core.get(get_current_env(), "report-counters");
@@ -465,8 +460,8 @@ return squint_core.update(acc, k7, squint_core.fnil(squint_core.conj, []), v);
465
460
 
466
461
  }), ({}), test_vars2);
467
462
  const run_groups8 = (function () {
468
- return squint_core.reduce((function (chain, p__28) {
469
- const vec__912 = p__28;
463
+ return squint_core.reduce((function (chain, p__45) {
464
+ const vec__912 = p__45;
470
465
  const ns_str13 = squint_core.nth(vec__912, 0, null);
471
466
  const vars14 = squint_core.nth(vec__912, 1, null);
472
467
  if (squint_core.truth_(async_QMARK_(chain))) {
@@ -492,12 +487,12 @@ return chain17.then(finish15)} else {
492
487
  return finish15(null)};
493
488
 
494
489
  });
495
- const f25 = (function (...rest26) {
496
- return impl271((((rest26.length === 0)) ? (null) : (rest26)));
490
+ const f42 = (function (...rest43) {
491
+ return impl441((((rest43.length === 0)) ? (null) : (rest43)));
497
492
 
498
493
  });
499
- (f25["squint$lang$variadic"] = impl271);
500
- return f25;
494
+ (f42["squint$lang$variadic"] = impl441);
495
+ return f42;
501
496
 
502
497
  })();
503
498