Skip to content

Commit 7341f93

Browse files
authored
Convert package to esm (#161)
1 parent e23406f commit 7341f93

16 files changed

+2069
-1449
lines changed

.eslintrc.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"es6": false
77
},
88
"parserOptions": {
9-
"ecmaVersion": 5
9+
"ecmaVersion": 6,
10+
"sourceType": "module"
1011
},
1112
"rules": {
1213
// Possible errors

.mocharc.js

-5
This file was deleted.

.mocharc.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"require": "./test/common.js"
3+
}

lib/sinon-chai.js

+2-20
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,6 @@
1-
"use strict";
21
/* eslint-disable no-invalid-this */
32

4-
(function (sinonChai) {
5-
// Module systems magic dance.
6-
7-
/* istanbul ignore else */
8-
if (typeof require === "function" && typeof exports === "object" && typeof module === "object") {
9-
// NodeJS
10-
module.exports = sinonChai;
11-
} else if (typeof define === "function" && define.amd) {
12-
// AMD
13-
define(function () {
14-
return sinonChai;
15-
});
16-
} else {
17-
// Other environment (usually <script> tag): plug in to global chai instance directly.
18-
/* global chai: false */
19-
chai.use(sinonChai);
20-
}
21-
}(function (chai, utils) {
3+
export default function (chai, utils) {
224
var slice = Array.prototype.slice;
235

246
function isSpy(putativeSpy) {
@@ -146,4 +128,4 @@
146128
sinonMethod("calledWithMatch", "been called with arguments matching %*", "%D");
147129
sinonMethod("returned", "returned %1");
148130
exceptionalSinonMethod("thrown", "threw", "thrown %1");
149-
}));
131+
}

0 commit comments

Comments
 (0)