We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb97e1e commit 279aaccCopy full SHA for 279aacc
chapter_02-a-first-unit-test/LogAn/ArgumentError.js
@@ -0,0 +1,3 @@
1
+class ArgumentError extends Error {}
2
+
3
+module.exports = ArgumentError;
chapter_02-a-first-unit-test/LogAn/logAnalyzer.js
@@ -1,9 +1,15 @@
+const ArgumentError = require('./ArgumentError');
function logAnalyzer() {
4
/**
5
* @param {string} fileName
6
* @return {boolean}
7
*/
8
function isValidLogFileName(fileName) {
9
+ if (fileName === '') {
10
+ throw new ArgumentError('filename has to be provided');
11
+ }
12
13
if (!fileName.toUpperCase().endsWith('.SLF')) {
14
return false;
15
}
0 commit comments