Updated the test system
This commit is contained in:
21
test/castArray.test.js
Normal file
21
test/castArray.test.js
Normal file
@ -0,0 +1,21 @@
|
||||
const expect = require('expect');
|
||||
const {castArray} = require('./_30s.js');
|
||||
|
||||
test('castArray is a Function', () => {
|
||||
expect(castArray).toBeInstanceOf(Function);
|
||||
});
|
||||
test('Works for single values', () => {
|
||||
expect(castArray(1)).toEqual([1]);
|
||||
});
|
||||
test('Works for arrays with one value', () => {
|
||||
expect(castArray([1])).toEqual([1]);
|
||||
});
|
||||
test('Works for arrays with multiple value', () => {
|
||||
expect(castArray([1, 2, 3])).toEqual([1, 2, 3]);
|
||||
});
|
||||
test('Works for strings', () => {
|
||||
expect(castArray('test')).toEqual(['test']);
|
||||
});
|
||||
test('Works for objects', () => {
|
||||
expect(castArray({})).toEqual([{}]);
|
||||
});
|
||||
Reference in New Issue
Block a user