diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..9ba90d5 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,6 @@ +module.exports = { + presets: [ + ['@babel/preset-env', {targets: {node: 'current'}}], + '@babel/preset-typescript', + ], +}; \ No newline at end of file diff --git a/package.json b/package.json index 355635c..855ad48 100644 --- a/package.json +++ b/package.json @@ -22,20 +22,23 @@ }, "homepage": "https://github.com/codeceptjs/mailslurp-helper#readme", "dependencies": { - "chai": "^4.3.4", "expect": "^30.2.0", "mailslurp-client": "^16.0.0", "ts-node": "^10.9.2" }, "devDependencies": { + "@babel/core": "^7.28.4", + "@babel/preset-env": "^7.28.3", + "@babel/preset-typescript": "^7.27.1", "@types/jest": "^29.5.14", + "babel-jest": "^30.2.0", "codeceptjs": "^3.7.3", "documentation": "^14.0.3", "dotenv": "^17.2.3", "jest": "30.2.0", "nock": "^14.0.1", "semantic-release": "^24.0.0", - "ts-jest": "^29.2.6", + "ts-jest": "^29.4.4", "typescript": "^5.8.2" }, "files": [ diff --git a/tests/index.spec.ts b/tests/index.spec.ts index b381853..43473e2 100644 --- a/tests/index.spec.ts +++ b/tests/index.spec.ts @@ -1,6 +1,6 @@ import nock from 'nock'; require('dotenv').config(); -import { expect } from 'chai'; +import {expect, test} from '@jest/globals'; import MailSlurp = require("../src"); import fs from 'fs'; @@ -97,10 +97,9 @@ describe('MailSlurp helper', function () { test('should create an inbox', async () => { const mailbox = await I.haveNewMailbox(); - expect(mailbox.id).to.be.a('string'); - expect(mailbox.emailAddress).to.be.a('string'); - expect(mailbox.emailAddress).to.contain('@'); - expect(mailbox.toString()).to.eql(mailbox.emailAddress); + expect(mailbox.id).toBe('123'); + expect(mailbox.emailAddress).toBe('hello@test.de'); + expect(mailbox.toString()).toEqual(mailbox.emailAddress); }); test('should send and receive an email', async () => { @@ -122,7 +121,7 @@ describe('MailSlurp helper', function () { attachments: [ attachmentId ] }); const email = await I.waitForLatestEmail(50); - expect(email.body.trim()).to.eql('Testing'); + expect(email.body.trim()).toEqual('Testing'); await I.seeInEmailSubject('Hello'); await I.seeEmailSubjectEquals('Hello Test'); await I.seeEmailIsFrom(mailbox.emailAddress); @@ -149,7 +148,7 @@ describe('MailSlurp helper', function () { }); // Since the persistent mock returns emailObj, this should work - expect(email.body.trim()).to.eql('Testing'); + expect(email.body.trim()).toEqual('Testing'); await I.seeInEmailSubject('Hello'); await I.seeEmailSubjectEquals('Hello Test'); }, 10000);