Skip to content

Commit 2994d68

Browse files
committed
prettier
1 parent d177445 commit 2994d68

4 files changed

Lines changed: 49 additions & 64 deletions

File tree

eslint.config.js

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,45 @@
33
const sinonConfig = require("@sinonjs/eslint-config");
44

55
module.exports = [
6-
{
7-
ignores: [
8-
"eslint.config.js",
9-
"coverage/**",
10-
".worktrees/**",
11-
"**/.worktrees/**",
12-
"site/**",
13-
"nise.js",
14-
],
15-
},
16-
...sinonConfig,
17-
{
18-
files: ["lib/**/*.js", "lib/**/*.test.js"],
19-
rules: {
20-
"no-unused-vars": [
21-
"error",
22-
{ vars: "all", args: "after-used", caughtErrors: "none" },
23-
],
6+
{
7+
ignores: [
8+
"eslint.config.js",
9+
"coverage/**",
10+
".worktrees/**",
11+
"**/.worktrees/**",
12+
"site/**",
13+
"nise.js",
14+
],
2415
},
25-
},
26-
{
27-
files: ["lib/**/*.test.js"],
28-
rules: {
29-
"mocha/consistent-spacing-between-blocks": "off",
16+
...sinonConfig,
17+
{
18+
files: ["lib/**/*.js", "lib/**/*.test.js"],
19+
rules: {
20+
"no-unused-vars": [
21+
"error",
22+
{ vars: "all", args: "after-used", caughtErrors: "none" },
23+
],
24+
},
3025
},
31-
},
32-
{
33-
languageOptions: {
34-
globals: {
35-
BigInt: false,
36-
Int8Array: false,
37-
Int16Array: false,
38-
Int32Array: false,
39-
Promise: false,
40-
Uint8Array: false,
41-
Uint8ClampedArray: false,
42-
Uint16Array: false,
43-
Uint32Array: false,
44-
},
26+
{
27+
files: ["lib/**/*.test.js"],
28+
rules: {
29+
"mocha/consistent-spacing-between-blocks": "off",
30+
},
31+
},
32+
{
33+
languageOptions: {
34+
globals: {
35+
BigInt: false,
36+
Int8Array: false,
37+
Int16Array: false,
38+
Int32Array: false,
39+
Promise: false,
40+
Uint8Array: false,
41+
Uint8ClampedArray: false,
42+
Uint16Array: false,
43+
Uint32Array: false,
44+
},
45+
},
4546
},
46-
},
4747
];

lib/fake-server/index.test.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,6 @@ describe("sinonFakeServer", function () {
676676
// setup client
677677
// Build Android like format (manual jsdom, with window.window inset)
678678
var html =
679-
680679
'<!doctype html><html><head><meta charset="utf-8">' +
681680
"</head><body></body></html>";
682681
var options = {};
@@ -869,7 +868,7 @@ describe("sinonFakeServer", function () {
869868
xhr.respond(
870869
200,
871870
{ "Content-Type": "application/json" },
872-
871+
873872
'{"id":42}',
874873
);
875874
});
@@ -886,7 +885,7 @@ describe("sinonFakeServer", function () {
886885
});
887886
assert.equals(
888887
request.responseText,
889-
888+
890889
'{"id":42}',
891890
);
892891
});
@@ -937,7 +936,6 @@ describe("sinonFakeServer", function () {
937936
assert(handler.calledOnce);
938937
});
939938

940-
941939
it("yields response to request function handler when url is a function that returns true with no Http Method specified", function () {
942940
var handler = sinon.spy();
943941
this.server.respondWith(equalMatcher("/hello?world"), handler);
@@ -962,7 +960,6 @@ describe("sinonFakeServer", function () {
962960
assert(!handler.called);
963961
});
964962

965-
966963
it("does not yield response to request function handler when method does not match (using url mather function)", function () {
967964
var handler = sinon.spy();
968965
this.server.respondWith("GET", equalMatcher("/hello"), handler);
@@ -1011,7 +1008,6 @@ describe("sinonFakeServer", function () {
10111008
assert(!handler.called);
10121009
});
10131010

1014-
10151011
it("does not yield response to request function handler when urlMatcher function returns non Boolean truthy value", function () {
10161012
var handler = sinon.spy();
10171013
this.server.respondWith(
@@ -1030,7 +1026,6 @@ describe("sinonFakeServer", function () {
10301026
assert(!handler.called);
10311027
});
10321028

1033-
10341029
it("does not yield response to request function handler when urlMatcher function returns non Boolean falsey value", function () {
10351030
var handler = sinon.spy();
10361031
this.server.respondWith(
@@ -1054,7 +1049,7 @@ describe("sinonFakeServer", function () {
10541049
xhr.respond(
10551050
200,
10561051
{ "Content-Type": "application/json" },
1057-
1052+
10581053
'{"id":42}',
10591054
);
10601055
});
@@ -1071,7 +1066,7 @@ describe("sinonFakeServer", function () {
10711066
});
10721067
assert.equals(
10731068
request.responseText,
1074-
1069+
10751070
'{"id":42}',
10761071
);
10771072
});

lib/fake-xhr/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,14 +494,12 @@ function fakeXMLHttpRequestFor(globalScope) {
494494
xhr.addEventListener("readystatechange", stateChangeStart);
495495

496496
Object.keys(fakeXhr.eventListeners).forEach(function (event) {
497-
498497
fakeXhr.eventListeners[event].forEach(function (handler) {
499498
xhr.addEventListener(event, handler.listener, {
500499
capture: handler.capture,
501500
once: handler.once,
502501
});
503502
});
504-
505503
});
506504

507505
xhr.addEventListener("readystatechange", stateChangeEnd);

lib/fake-xhr/index.test.js

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ function fakeXhrTearDown() {
4646
function runWithWorkingXHROveride(workingXHR, test) {
4747
var original;
4848
try {
49-
5049
original = sinonFakeXhr.xhr.workingXHR;
5150
sinonFakeXhr.xhr.workingXHR = workingXHR;
5251
test();
@@ -1483,13 +1482,11 @@ describe("FakeXMLHttpRequest", function () {
14831482

14841483
// eslint-disable-next-line mocha/no-setup-in-describe
14851484
assertRequestErrorSteps(function (xhr) {
1486-
14871485
xhr.abort();
14881486
});
14891487

14901488
// eslint-disable-next-line mocha/no-setup-in-describe
14911489
assertEventOrdering("abort", 0, function (xhr) {
1492-
14931490
xhr.abort();
14941491
});
14951492
});
@@ -1559,7 +1556,6 @@ describe("FakeXMLHttpRequest", function () {
15591556

15601557
// eslint-disable-next-line mocha/no-setup-in-describe
15611558
assertEventOrdering("error", 0, function (xhr) {
1562-
15631559
xhr.error();
15641560
});
15651561
});
@@ -1662,13 +1658,11 @@ describe("FakeXMLHttpRequest", function () {
16621658

16631659
// eslint-disable-next-line mocha/no-setup-in-describe
16641660
assertRequestErrorSteps(function (xhr) {
1665-
16661661
xhr.triggerTimeout();
16671662
});
16681663

16691664
// eslint-disable-next-line mocha/no-setup-in-describe
16701665
assertEventOrdering("timeout", 0, function (xhr) {
1671-
16721666
xhr.triggerTimeout();
16731667
});
16741668
});
@@ -2080,7 +2074,7 @@ describe("FakeXMLHttpRequest", function () {
20802074
this.xhr.respond(
20812075
200,
20822076
{ "Content-Type": "application/xml" },
2083-
2077+
20842078
'!!!<?xml version="1.0" encoding="UTF-8"?><broken>',
20852079
);
20862080

@@ -2372,7 +2366,6 @@ describe("FakeXMLHttpRequest", function () {
23722366

23732367
it("performs initial readystatechange on opening when filters are being used, but don't match", function () {
23742368
try {
2375-
23762369
FakeXMLHttpRequest.useFilters = true;
23772370
var spy = sinonSpy();
23782371
fakeXhr.addEventListener("readystatechange", spy);
@@ -2618,37 +2611,37 @@ describe("FakeXMLHttpRequest", function () {
26182611
it("hijacks ActiveXObject", function () {
26192612
refute.same(global.ActiveXObject, globalActiveXObject);
26202613
refute.same(global.ActiveXObject, globalActiveXObject);
2621-
refute.same(ActiveXObject, globalActiveXObject);
2614+
refute.same(ActiveXObject, globalActiveXObject);
26222615
});
26232616

26242617
it("restores global ActiveXObject", function () {
26252618
fakeXhr.restore();
26262619

26272620
assert.same(global.ActiveXObject, globalActiveXObject);
26282621
assert.same(global.ActiveXObject, globalActiveXObject);
2629-
assert.same(ActiveXObject, globalActiveXObject);
2622+
assert.same(ActiveXObject, globalActiveXObject);
26302623
});
26312624

26322625
it("creates FakeXHR object with ActiveX Microsoft.XMLHTTP", function () {
2633-
var xhr = new ActiveXObject("Microsoft.XMLHTTP");
2626+
var xhr = new ActiveXObject("Microsoft.XMLHTTP");
26342627

26352628
assert(xhr instanceof FakeXMLHttpRequest);
26362629
});
26372630

26382631
it("creates FakeXHR object with ActiveX Msxml2.XMLHTTP", function () {
2639-
var xhr = new ActiveXObject("Msxml2.XMLHTTP");
2632+
var xhr = new ActiveXObject("Msxml2.XMLHTTP");
26402633

26412634
assert(xhr instanceof FakeXMLHttpRequest);
26422635
});
26432636

26442637
it("creates FakeXHR object with ActiveX Msxml2.XMLHTTP.3.0", function () {
2645-
var xhr = new ActiveXObject("Msxml2.XMLHTTP.3.0");
2638+
var xhr = new ActiveXObject("Msxml2.XMLHTTP.3.0");
26462639

26472640
assert(xhr instanceof FakeXMLHttpRequest);
26482641
});
26492642

26502643
it("creates FakeXHR object with ActiveX Msxml2.XMLHTTP.6.0", function () {
2651-
var xhr = new ActiveXObject("Msxml2.XMLHTTP.6.0");
2644+
var xhr = new ActiveXObject("Msxml2.XMLHTTP.6.0");
26522645

26532646
assert(xhr instanceof FakeXMLHttpRequest);
26542647
});
@@ -2931,7 +2924,6 @@ describe("FakeXMLHttpRequest", function () {
29312924

29322925
// eslint-disable-next-line mocha/no-setup-in-describe
29332926
assertEventOrdering("load", 100, function (xhr) {
2934-
29352927
xhr.respond(200, {}, "");
29362928
});
29372929

0 commit comments

Comments
 (0)