Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e82cd10

Browse files
committed
refactore: migrate check-errors
1 parent 0e0313a commit e82cd10

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

extensions/check-error.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { CONSTANTS } from './constants.js';
1+
const { CONSTANTS } = require('./constants.js');
22

33
const { SPECIAL_PROP_VALUE, CORRECT_RESULT_MSG, INCORRECT_RESULT_MSG } = CONSTANTS;
44

5-
export const checkForThrowingErrors = function (testsFuncs, expectedErrMsg) {
5+
const checkForThrowingErrors = function (testsFuncs, expectedErrMsg) {
66
return testsFuncs.map(f => {
77
try {
88
f();
@@ -16,7 +16,7 @@ export const checkForThrowingErrors = function (testsFuncs, expectedErrMsg) {
1616
});
1717
};
1818

19-
export const checkForNotThrowingErrors = function (testFuncs) {
19+
const checkForNotThrowingErrors = function (testFuncs) {
2020
return testFuncs.map(f => {
2121
try {
2222
f();
@@ -28,4 +28,9 @@ export const checkForNotThrowingErrors = function (testFuncs) {
2828
}
2929
}
3030
});
31+
};
32+
33+
module.exports = {
34+
checkForThrowingErrors,
35+
checkForNotThrowingErrors
3136
};

0 commit comments

Comments
 (0)