Skip to content

Commit

Permalink
test: convert to ES Module
Browse files Browse the repository at this point in the history
Signed-off-by: Rifa Achrinza <[email protected]>
  • Loading branch information
achrinza committed Feb 26, 2024
1 parent bb12eaf commit 4528459
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions test/handler.test.js → test/handler.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@

'use strict';

const cloneAllProperties = require('../lib/clone.js');
const debug = require('debug')('test');
const expect = require('chai').expect;
const express = require('express');
const strongErrorHandler = require('..');
const supertest = require('supertest');
const util = require('util');
import cloneAllProperties from '../lib/clone.js';
import debugFactory from 'debug';
import express from 'express';
import strongErrorHandler from '../lib/handler.js';
import supertest from 'supertest';
import util from 'node:util';
import {expect} from 'chai';

const debug = debugFactory('test');

describe('strong-error-handler', function() {
before(setupHttpServerAndClient);
Expand Down Expand Up @@ -137,8 +139,7 @@ describe('strong-error-handler', function() {
// the error name & message
expect(msg).to.contain('TypeError: ERROR-NAME');
// the stack
expect(msg).to.contain(__filename);

expect(msg).to.contain(import.meta.url);
done();
});
});
Expand All @@ -161,7 +162,7 @@ describe('strong-error-handler', function() {
expect(msg).to.contain('TypeError: ERR1');
expect(msg).to.contain('Error: ERR2');
// verify that stacks are included too
expect(msg).to.contain(__filename);
expect(msg).to.contain(import.meta.url);

done();
});
Expand Down

0 comments on commit 4528459

Please sign in to comment.