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 2a31489 commit 18472acCopy full SHA for 18472ac
exercises/140-modulo/test.js
@@ -1,3 +1,5 @@
1
+const fs = require('fs');
2
+const path = require('path');
3
const rewire = require('rewire');
4
const modulo = rewire('./app.js').__get__('modulo');
5
@@ -32,3 +34,11 @@ test('The module always returns the sign of the first number. Testing with (-25,
32
34
test('If any of the operators is different from a number, then the result is NaN', () => {
33
35
expect(modulo(25, 'hey')).toBe(NaN);
36
});
37
+
38
+test('You should not use the modulo operator (%) at all', () => {
39
+ const file = fs.readFileSync(path.resolve(__dirname, './app.js'), 'utf8');
40
+ const regex = /\s*%\s*/gm
41
+ expect(regex.test(file.toString())).toBeFalsy();
42
+});
43
44
0 commit comments