Test cleanup and fixes [c-d]
This commit is contained in:
@ -1,24 +1,21 @@
|
||||
const expect = require('expect');
|
||||
const castArray = require('./castArray.js');
|
||||
|
||||
|
||||
test('castArray is a Function', () => {
|
||||
test('castArray is a Function', () => {
|
||||
expect(castArray).toBeInstanceOf(Function);
|
||||
});
|
||||
test('Works for single values', () => {
|
||||
expect(castArray(1), [1]).toEqual()
|
||||
test('Works for single values', () => {
|
||||
expect(castArray(1)).toEqual([1]);
|
||||
});
|
||||
test('Works for arrays with one value', () => {
|
||||
expect(castArray([1]), [1]).toEqual()
|
||||
test('Works for arrays with one value', () => {
|
||||
expect(castArray([1])).toEqual([1]);
|
||||
});
|
||||
test('Works for arrays with multiple value', () => {
|
||||
expect(castArray([1,2,3]), [1,2,3]).toEqual()
|
||||
test('Works for arrays with multiple value', () => {
|
||||
expect(castArray([1,2,3])).toEqual( [1,2,3]);
|
||||
});
|
||||
test('Works for strings', () => {
|
||||
expect(castArray('test'), ['test']).toEqual()
|
||||
test('Works for strings', () => {
|
||||
expect(castArray('test')).toEqual(['test'])
|
||||
});
|
||||
test('Works for objects', () => {
|
||||
expect(castArray({}), [{}]).toEqual()
|
||||
test('Works for objects', () => {
|
||||
expect(castArray({})).toEqual([{}])
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user