Skip to content

Commit 2362471

Browse files
committed
add remove it.only lint task
1 parent 7e84230 commit 2362471

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

src/decimal128.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,10 @@ export class Decimal128 {
134134
if (typeof bytes === 'string') {
135135
this.bytes = Decimal128.fromString(bytes).bytes;
136136
} else if (isUint8Array(bytes)) {
137-
if (bytes.byteLength === 16) {
138-
this.bytes = bytes;
139-
} else {
137+
if (bytes.byteLength !== 16) {
140138
throw new BSONTypeError('Decimal128 must take a Buffer of 16 bytes');
141139
}
140+
this.bytes = bytes;
142141
} else {
143142
throw new BSONTypeError('Decimal128 must take a Buffer or string');
144143
}

test/.eslintrc.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,21 @@
3131
"error",
3232
"global"
3333
],
34-
"promise/no-native": "off"
34+
"promise/no-native": "off",
35+
"no-restricted-properties": [
36+
"error",
37+
{
38+
"object": "describe",
39+
"property": "only"
40+
},
41+
{
42+
"object": "it",
43+
"property": "only"
44+
},
45+
{
46+
"object": "context",
47+
"property": "only"
48+
}
49+
]
3550
}
3651
}

test/node/decimal128_tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,7 @@ describe('Decimal128', function () {
12191219
expect(new Decimal128('-1e400').toString()).to.equal('-1E+400');
12201220
});
12211221

1222-
it.only('throws appropriate error for invalid constructor arguments', () => {
1222+
it('throws appropriate error for invalid constructor arguments', () => {
12231223
const byteLengthErrMsg = 'Decimal128 must take a Buffer of 16 bytes';
12241224
const constructorArgErrMsg = 'Decimal128 must take a Buffer or string';
12251225

0 commit comments

Comments
 (0)