Skip to content

Commit 8ef9a81

Browse files
committed
test(models): reorganize instance tests
Signed-off-by: Lexus Drumgold <[email protected]>
1 parent 7547e7e commit 8ef9a81

19 files changed

+29
-19
lines changed

src/models/__tests__/err-ambiguous-argument.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ describe('unit:models/ERR_AMBIGUOUS_ARGUMENT', () => {
1919
})
2020

2121
it('should return TypeError instance', () => {
22-
expect(result).to.have.property('name').equal('TypeError')
2322
expect(result).to.be.instanceof(TypeError)
23+
expect(result).to.have.property('name').equal('TypeError')
2424
})
2525

2626
it('should set error code', () => {

src/models/__tests__/err-arg-not-iterable.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ describe('unit:models/ERR_ARG_NOT_ITERABLE', () => {
1717
})
1818

1919
it('should return TypeError instance', () => {
20-
expect(result).to.have.property('name').equal('TypeError')
2120
expect(result).to.be.instanceof(TypeError)
21+
expect(result).to.have.property('name').equal('TypeError')
2222
})
2323

2424
it('should set error code', () => {

src/models/__tests__/err-async-callback.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ describe('unit:models/ERR_ASYNC_CALLBACK', () => {
1717
})
1818

1919
it('should return TypeError instance', () => {
20-
expect(result).to.have.property('name').equal('TypeError')
2120
expect(result).to.be.instanceof(TypeError)
21+
expect(result).to.have.property('name').equal('TypeError')
2222
})
2323

2424
it('should set error code', () => {

src/models/__tests__/err-illegal-constructor.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ describe('unit:models/ERR_ILLEGAL_CONSTRUCTOR', () => {
1515
})
1616

1717
it('should return TypeError instance', () => {
18-
expect(result).to.have.property('name').equal('TypeError')
1918
expect(result).to.be.instanceof(TypeError)
19+
expect(result).to.have.property('name').equal('TypeError')
2020
})
2121

2222
it('should set error code', () => {

src/models/__tests__/err-import-assertion-type-failed.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ describe('unit:models/ERR_IMPORT_ASSERTION_TYPE_FAILED', () => {
1919
})
2020

2121
it('should return TypeError instance', () => {
22-
expect(result).to.have.property('name').equal('TypeError')
2322
expect(result).to.be.instanceof(TypeError)
23+
expect(result).to.have.property('name').equal('TypeError')
2424
})
2525

2626
it('should set error code', () => {

src/models/__tests__/err-import-assertion-type-missing.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ describe('unit:models/ERR_IMPORT_ASSERTION_TYPE_MISSING', () => {
2020
})
2121

2222
it('should return TypeError instance', () => {
23-
expect(result).to.have.property('name').equal('TypeError')
2423
expect(result).to.be.instanceof(TypeError)
24+
expect(result).to.have.property('name').equal('TypeError')
2525
})
2626

2727
it('should set error code', () => {

src/models/__tests__/err-import-assertion-type-unsupported.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ describe('unit:models/ERR_IMPORT_ASSERTION_TYPE_UNSUPPORTED', () => {
1717
})
1818

1919
it('should return TypeError instance', () => {
20-
expect(result).to.have.property('name').equal('TypeError')
2120
expect(result).to.be.instanceof(TypeError)
21+
expect(result).to.have.property('name').equal('TypeError')
2222
})
2323

2424
it('should set error code', () => {

src/models/__tests__/err-incompatible-option-pair.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ describe('unit:models/ERR_INCOMPATIBLE_OPTION_PAIR', () => {
1919
})
2020

2121
it('should return TypeError instance', () => {
22-
expect(result).to.have.property('name').equal('TypeError')
2322
expect(result).to.be.instanceof(TypeError)
23+
expect(result).to.have.property('name').equal('TypeError')
2424
})
2525

2626
it('should set error code', () => {

src/models/__tests__/err-invalid-module-specifier.spec.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ describe('unit:models/ERR_INVALID_MODULE_SPECIFIER', () => {
2020
})
2121

2222
it('should return TypeError instance', () => {
23-
expect(new TestSubject(request, reason)).to.be.instanceof(TypeError)
23+
// Act
24+
const result = new TestSubject(request, reason)
25+
26+
// Expect
27+
expect(result).to.be.instanceof(TypeError)
28+
expect(result).to.have.property('name').equal('TypeError')
2429
})
2530

2631
it('should set error code', () => {

src/models/__tests__/err-method-not-implemented.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ describe('unit:models/ERR_METHOD_NOT_IMPLEMENTED', () => {
1717
})
1818

1919
it('should return Error instance', () => {
20-
expect(result).to.have.property('name').equal('Error')
2120
expect(result).to.be.instanceof(Error)
21+
expect(result).to.have.property('name').equal('Error')
2222
})
2323

2424
it('should set error code', () => {

0 commit comments

Comments
 (0)