* chore: make aware eslint that we use jest By setting up the jest environment, we no longer need to declare the 'test' global in the configuration. * chore: don't need to import expect, it's a jest environment global * chore: don't need to import expect when creating undefined test
12 lines
462 B
JavaScript
12 lines
462 B
JavaScript
const {initialize2DArray} = require('./_30s.js');
|
|
|
|
test('initialize2DArray is a Function', () => {
|
|
expect(initialize2DArray).toBeInstanceOf(Function);
|
|
});
|
|
test('Initializes a 2D array of given width and height and value', () => {
|
|
expect(initialize2DArray(2, 2, 0)).toEqual([[0, 0], [0, 0]]);
|
|
});
|
|
test('Initializes a 2D array of given width and height and value (no fill)', () => {
|
|
expect(initialize2DArray(2, 2)).toEqual([[null, null], [null, null]]);
|
|
});
|