Skip to content

Commit 455927b

Browse files
fix: use jest expect in UTs
* build(deps): bump chai from 4.5.0 to 6.2.0 Bumps [chai](https://github.com/chaijs/chai) from 4.5.0 to 6.2.0. - [Release notes](https://github.com/chaijs/chai/releases) - [Changelog](https://github.com/chaijs/chai/blob/main/History.md) - [Commits](chaijs/chai@v4.5.0...v6.2.0) --- updated-dependencies: - dependency-name: chai dependency-version: 6.2.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * use jest expect * use jest expect --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: kobenguyent <[email protected]>
1 parent bd939eb commit 455927b

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

babel.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
presets: [
3+
['@babel/preset-env', {targets: {node: 'current'}}],
4+
'@babel/preset-typescript',
5+
],
6+
};

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,23 @@
2222
},
2323
"homepage": "https://github.com/codeceptjs/mailslurp-helper#readme",
2424
"dependencies": {
25-
"chai": "^4.3.4",
2625
"expect": "^30.2.0",
2726
"mailslurp-client": "^16.0.0",
2827
"ts-node": "^10.9.2"
2928
},
3029
"devDependencies": {
30+
"@babel/core": "^7.28.4",
31+
"@babel/preset-env": "^7.28.3",
32+
"@babel/preset-typescript": "^7.27.1",
3133
"@types/jest": "^29.5.14",
34+
"babel-jest": "^30.2.0",
3235
"codeceptjs": "^3.7.3",
3336
"documentation": "^14.0.3",
3437
"dotenv": "^17.2.3",
3538
"jest": "30.2.0",
3639
"nock": "^14.0.1",
3740
"semantic-release": "^24.0.0",
38-
"ts-jest": "^29.2.6",
41+
"ts-jest": "^29.4.4",
3942
"typescript": "^5.8.2"
4043
},
4144
"files": [

tests/index.spec.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import nock from 'nock';
22
require('dotenv').config();
3-
import { expect } from 'chai';
3+
import {expect, test} from '@jest/globals';
44
import MailSlurp = require("../src");
55
import fs from 'fs';
66

@@ -97,10 +97,9 @@ describe('MailSlurp helper', function () {
9797

9898
test('should create an inbox', async () => {
9999
const mailbox = await I.haveNewMailbox();
100-
expect(mailbox.id).to.be.a('string');
101-
expect(mailbox.emailAddress).to.be.a('string');
102-
expect(mailbox.emailAddress).to.contain('@');
103-
expect(mailbox.toString()).to.eql(mailbox.emailAddress);
100+
expect(mailbox.id).toBe('123');
101+
expect(mailbox.emailAddress).toBe('[email protected]');
102+
expect(mailbox.toString()).toEqual(mailbox.emailAddress);
104103
});
105104

106105
test('should send and receive an email', async () => {
@@ -122,7 +121,7 @@ describe('MailSlurp helper', function () {
122121
attachments: [ attachmentId ]
123122
});
124123
const email = await I.waitForLatestEmail(50);
125-
expect(email.body.trim()).to.eql('Testing');
124+
expect(email.body.trim()).toEqual('Testing');
126125
await I.seeInEmailSubject('Hello');
127126
await I.seeEmailSubjectEquals('Hello Test');
128127
await I.seeEmailIsFrom(mailbox.emailAddress);
@@ -149,7 +148,7 @@ describe('MailSlurp helper', function () {
149148
});
150149

151150
// Since the persistent mock returns emailObj, this should work
152-
expect(email.body.trim()).to.eql('Testing');
151+
expect(email.body.trim()).toEqual('Testing');
153152
await I.seeInEmailSubject('Hello');
154153
await I.seeEmailSubjectEquals('Hello Test');
155154
}, 10000);

0 commit comments

Comments
 (0)