Skip to content

Commit 19c779e

Browse files
committed
Apply Prettier 3 defaults of trailing commas
1 parent 9b69a1f commit 19c779e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+568
-572
lines changed

CHANGES.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ _Released by Morgan Roderick on 2023-09-13._
5555
- [`a79ccaeb`](https://github.com/sinonjs/sinon/commit/a79ccaeb20bbb558902ae77b20bd026719de3004)
5656
Support callable instances (#2517) (bojavou)
5757
> - Support callable instances
58-
>
5958
> - Clean prettier lint
6059
>
6160
> ***
@@ -252,7 +251,6 @@ _Released by [Carl-Erik Kopseng](https://github.com/fatso83) on 2022-04-14._
252251
- [`51c508ab`](https://github.com/sinonjs/sinon/commit/51c508ab77cf0f9fb8c5305ff626f6a2eada178f)
253252
Add dry run mode to `npm version` (#2436) (Joel Bradshaw)
254253
> - Add DRY_RUN flag to skip publish/push
255-
>
256254
> - Allow overriding branch names for testing
257255
- [`05341dcf`](https://github.com/sinonjs/sinon/commit/05341dcf92ddca4a1d4c90966b1fcdc7039cff18)
258256
Update npm version scripts to manage new releases branch (Joel Bradshaw)
@@ -282,7 +280,6 @@ _Released by [Carl-Erik Kopseng](https://github.com/fatso83) on 2022-02-01._
282280
Upgrade packages (#2431) (Carl-Erik Kopseng)
283281
> - Update all @sinonjs/ packages
284282
> - Upgrade to fake-timers 9
285-
>
286283
> - chore: ensure always using latest LTS release
287284
- [`41710467`](https://github.com/sinonjs/sinon/commit/417104670d575e96a1b645ea40ce763afa76fb1b)
288285
Adjust deploy scripts to archive old releases in a separate branch, move existing releases out of master (#2426) (Joel Bradshaw)

docs/_howto/typescript-swc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Let us sprinkle some debugging statements to figure out what the differences bet
9696
console.log("Other", Other);
9797
console.log(
9898
"Other property descriptors",
99-
Object.getOwnPropertyDescriptors(Other)
99+
Object.getOwnPropertyDescriptors(Other),
100100
);
101101
```
102102

docs/changelog.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ _Released by Morgan Roderick on 2023-09-13._
6161
- [`a79ccaeb`](https://github.com/sinonjs/sinon/commit/a79ccaeb20bbb558902ae77b20bd026719de3004)
6262
Support callable instances (#2517) (bojavou)
6363
> - Support callable instances
64-
>
6564
> - Clean prettier lint
6665
>
6766
> ***
@@ -258,7 +257,6 @@ _Released by [Carl-Erik Kopseng](https://github.com/fatso83) on 2022-04-14._
258257
- [`51c508ab`](https://github.com/sinonjs/sinon/commit/51c508ab77cf0f9fb8c5305ff626f6a2eada178f)
259258
Add dry run mode to `npm version` (#2436) (Joel Bradshaw)
260259
> - Add DRY_RUN flag to skip publish/push
261-
>
262260
> - Allow overriding branch names for testing
263261
- [`05341dcf`](https://github.com/sinonjs/sinon/commit/05341dcf92ddca4a1d4c90966b1fcdc7039cff18)
264262
Update npm version scripts to manage new releases branch (Joel Bradshaw)
@@ -288,7 +286,6 @@ _Released by [Carl-Erik Kopseng](https://github.com/fatso83) on 2022-02-01._
288286
Upgrade packages (#2431) (Carl-Erik Kopseng)
289287
> - Update all @sinonjs/ packages
290288
> - Upgrade to fake-timers 9
291-
>
292289
> - chore: ensure always using latest LTS release
293290
- [`41710467`](https://github.com/sinonjs/sinon/commit/417104670d575e96a1b645ea40ce763afa76fb1b)
294291
Adjust deploy scripts to archive old releases in a separate branch, move existing releases out of master (#2426) (Joel Bradshaw)

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ it("calls callback with deserialized data", function () {
208208
server.requests[0].respond(
209209
200,
210210
{ "Content-Type": "application/json" },
211-
JSON.stringify([{ id: 1, text: "Provide examples", done: true }])
211+
JSON.stringify([{ id: 1, text: "Provide examples", done: true }]),
212212
);
213213

214214
assert(callback.calledOnce);

docs/release-source/release/examples/spies-2-wrap-object-methods.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ describe("Wrap all object methods", function () {
3434
assert(myExternalLibrary._doNetworkCall.calledOnce);
3535
assert.equals(
3636
url,
37-
myExternalLibrary._doNetworkCall.getCall(0).args[0].url
37+
myExternalLibrary._doNetworkCall.getCall(0).args[0].url,
3838
);
3939
assert.equals(
4040
"json",
41-
myExternalLibrary._doNetworkCall.getCall(0).args[0].dataType
41+
myExternalLibrary._doNetworkCall.getCall(0).args[0].dataType,
4242
);
4343
});
4444
});

docs/release-source/release/fake-xhr-and-server.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ server.respondWith(/\/todo-items\/(\d+)/, function (xhr, id) {
269269
xhr.respond(
270270
200,
271271
{ "Content-Type": "application/json" },
272-
'[{ "id": ' + id + " }]"
272+
'[{ "id": ' + id + " }]",
273273
);
274274
});
275275
```

lib/sinon.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const apiMethods = {
3030
fakeServerWithClock: nise.fakeServerWithClock,
3131
createFakeServer: nise.fakeServer.create.bind(nise.fakeServer),
3232
createFakeServerWithClock: nise.fakeServerWithClock.create.bind(
33-
nise.fakeServerWithClock
33+
nise.fakeServerWithClock,
3434
),
3535

3636
addBehavior: function (name, fn) {

lib/sinon/assert.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function createAssertObject() {
5252

5353
failAssertion(
5454
this,
55-
`expected ${expected} to be called in order but were called as ${actual}`
55+
`expected ${expected} to be called in order but were called as ${actual}`,
5656
);
5757
} else {
5858
assert.pass("callOrder");
@@ -151,7 +151,7 @@ function createAssertObject() {
151151
assert.fail(
152152
`${assertionMethod} takes 1 argument but was called with ${
153153
assertionArgs.length + 1
154-
} arguments`
154+
} arguments`,
155155
);
156156
}
157157
break;
@@ -196,8 +196,8 @@ function createAssertObject() {
196196
this,
197197
(fake.printf || fake.proxy.printf).apply(
198198
fake,
199-
concat([msg], args)
200-
)
199+
concat([msg], args),
200+
),
201201
);
202202
} else {
203203
assert.pass(name);
@@ -215,79 +215,79 @@ function createAssertObject() {
215215

216216
mirrorPropAsAssertion(
217217
"called",
218-
"expected %n to have been called at least once but was never called"
218+
"expected %n to have been called at least once but was never called",
219219
);
220220
mirrorPropAsAssertion(
221221
"notCalled",
222222
function (spy) {
223223
return !spy.called;
224224
},
225-
"expected %n to not have been called but was called %c%C"
225+
"expected %n to not have been called but was called %c%C",
226226
);
227227
mirrorPropAsAssertion(
228228
"calledOnce",
229-
"expected %n to be called once but was called %c%C"
229+
"expected %n to be called once but was called %c%C",
230230
);
231231
mirrorPropAsAssertion(
232232
"calledTwice",
233-
"expected %n to be called twice but was called %c%C"
233+
"expected %n to be called twice but was called %c%C",
234234
);
235235
mirrorPropAsAssertion(
236236
"calledThrice",
237-
"expected %n to be called thrice but was called %c%C"
237+
"expected %n to be called thrice but was called %c%C",
238238
);
239239
mirrorPropAsAssertion(
240240
"calledOn",
241-
"expected %n to be called with %1 as this but was called with %t"
241+
"expected %n to be called with %1 as this but was called with %t",
242242
);
243243
mirrorPropAsAssertion(
244244
"alwaysCalledOn",
245-
"expected %n to always be called with %1 as this but was called with %t"
245+
"expected %n to always be called with %1 as this but was called with %t",
246246
);
247247
mirrorPropAsAssertion("calledWithNew", "expected %n to be called with new");
248248
mirrorPropAsAssertion(
249249
"alwaysCalledWithNew",
250-
"expected %n to always be called with new"
250+
"expected %n to always be called with new",
251251
);
252252
mirrorPropAsAssertion(
253253
"calledWith",
254-
"expected %n to be called with arguments %D"
254+
"expected %n to be called with arguments %D",
255255
);
256256
mirrorPropAsAssertion(
257257
"calledWithMatch",
258-
"expected %n to be called with match %D"
258+
"expected %n to be called with match %D",
259259
);
260260
mirrorPropAsAssertion(
261261
"alwaysCalledWith",
262-
"expected %n to always be called with arguments %D"
262+
"expected %n to always be called with arguments %D",
263263
);
264264
mirrorPropAsAssertion(
265265
"alwaysCalledWithMatch",
266-
"expected %n to always be called with match %D"
266+
"expected %n to always be called with match %D",
267267
);
268268
mirrorPropAsAssertion(
269269
"calledWithExactly",
270-
"expected %n to be called with exact arguments %D"
270+
"expected %n to be called with exact arguments %D",
271271
);
272272
mirrorPropAsAssertion(
273273
"calledOnceWithExactly",
274-
"expected %n to be called once and with exact arguments %D"
274+
"expected %n to be called once and with exact arguments %D",
275275
);
276276
mirrorPropAsAssertion(
277277
"calledOnceWithMatch",
278-
"expected %n to be called once and with match %D"
278+
"expected %n to be called once and with match %D",
279279
);
280280
mirrorPropAsAssertion(
281281
"alwaysCalledWithExactly",
282-
"expected %n to always be called with exact arguments %D"
282+
"expected %n to always be called with exact arguments %D",
283283
);
284284
mirrorPropAsAssertion(
285285
"neverCalledWith",
286-
"expected %n to never be called with arguments %*%C"
286+
"expected %n to never be called with arguments %*%C",
287287
);
288288
mirrorPropAsAssertion(
289289
"neverCalledWithMatch",
290-
"expected %n to never be called with match %*%C"
290+
"expected %n to never be called with match %*%C",
291291
);
292292
mirrorPropAsAssertion("threw", "%n did not throw exception%C");
293293
mirrorPropAsAssertion("alwaysThrew", "%n did not always throw exception%C");

lib/sinon/behavior.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ function getCallbackError(behavior, func, args) {
5757

5858
if (behavior.callArgProp) {
5959
msg = `${functionName(
60-
behavior.stub
60+
behavior.stub,
6161
)} expected to yield to '${valueToString(
62-
behavior.callArgProp
62+
behavior.callArgProp,
6363
)}', but no object with such a property was passed.`;
6464
} else {
6565
msg = `${functionName(
66-
behavior.stub
66+
behavior.stub,
6767
)} expected to yield, but no callback was passed.`;
6868
}
6969

@@ -87,7 +87,7 @@ function ensureArgs(name, behavior, args) {
8787
throw new TypeError(
8888
`${name} failed: ${index + 1} arguments required but only ${
8989
args.length
90-
} present`
90+
} present`,
9191
);
9292
}
9393
}
@@ -105,13 +105,13 @@ function callCallback(behavior, args) {
105105
nextTick(function () {
106106
func.apply(
107107
behavior.callbackContext,
108-
behavior.callbackArguments
108+
behavior.callbackArguments,
109109
);
110110
});
111111
} else {
112112
return func.apply(
113113
behavior.callbackContext,
114-
behavior.callbackArguments
114+
behavior.callbackArguments,
115115
);
116116
}
117117
}
@@ -178,7 +178,7 @@ const proto = {
178178
} else if (typeof this.resolveArgAt === "number") {
179179
ensureArgs("resolvesArg", this, args);
180180
return (this.promiseLibrary || Promise).resolve(
181-
args[this.resolveArgAt]
181+
args[this.resolveArgAt],
182182
);
183183
} else if (this.resolveThis) {
184184
return (this.promiseLibrary || Promise).resolve(context);
@@ -198,7 +198,7 @@ const proto = {
198198
// Call the constructor
199199
const F = WrappedClass.bind.apply(
200200
WrappedClass,
201-
concat([null], argsArray)
201+
concat([null], argsArray),
202202
);
203203
return new F();
204204
} else if (typeof this.returnValue !== "undefined") {
@@ -239,7 +239,7 @@ const proto = {
239239
throw new Error(
240240
'Defining a stub by invoking "stub.onCall(...).withArgs(...)" ' +
241241
'is not supported. Use "stub.withArgs(...).onCall(...)" ' +
242-
"to define sequential behavior for calls with certain arguments."
242+
"to define sequential behavior for calls with certain arguments.",
243243
);
244244
},
245245
};
@@ -249,7 +249,7 @@ function createBehavior(behaviorMethod) {
249249
this.defaultBehavior = this.defaultBehavior || proto.create(this);
250250
this.defaultBehavior[behaviorMethod].apply(
251251
this.defaultBehavior,
252-
arguments
252+
arguments,
253253
);
254254
return this;
255255
};

lib/sinon/create-stub-instance.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module.exports = function createStubInstance(constructor, overrides) {
2828
}
2929
} else {
3030
throw new Error(
31-
`Cannot stub ${propertyName}. Property does not exist!`
31+
`Cannot stub ${propertyName}. Property does not exist!`,
3232
);
3333
}
3434
});

lib/sinon/default-behaviors.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function throwsException(fake, error, message) {
1616
} else if (typeof error === "string") {
1717
fake.exceptionCreator = function () {
1818
const newException = new Error(
19-
message || `Sinon-provided ${error}`
19+
message || `Sinon-provided ${error}`,
2020
);
2121
newException.name = error;
2222
return newException;
@@ -241,7 +241,7 @@ const defaultBehaviors = {
241241
get: getterFunction,
242242
configurable: isPropertyConfigurable(
243243
rootStub.rootObj,
244-
rootStub.propName
244+
rootStub.propName,
245245
),
246246
});
247247

@@ -259,9 +259,9 @@ const defaultBehaviors = {
259259
set: setterFunction,
260260
configurable: isPropertyConfigurable(
261261
rootStub.rootObj,
262-
rootStub.propName
262+
rootStub.propName,
263263
),
264-
}
264+
},
265265
);
266266

267267
return fake;

0 commit comments

Comments
 (0)