This commit is contained in:
Angelos Chalaris
2018-11-10 14:48:56 +02:00
parent b030bc4ca6
commit 4fd8f7bf2e
30 changed files with 93 additions and 9225 deletions

View File

@@ -1,21 +1,21 @@
const expect = require("expect");
const {shank} = require("./_30s.js");
const expect = require('expect');
const {shank} = require('./_30s.js');
test("shank is a Function", () => {
test('shank is a Function', () => {
expect(shank).toBeInstanceOf(Function);
});
const names = ['alpha', 'bravo', 'charlie'];
test("Returns an array with the added elements.", () => {
test('Returns an array with the added elements.', () => {
expect(shank(names, 1, 0, 'delta')).toEqual(['alpha', 'delta', 'bravo', 'charlie']);
});
test("Returns an array with the removed elements.", () => {
test('Returns an array with the removed elements.', () => {
expect(shank(names, 1, 1)).toEqual(['alpha', 'charlie']);
});
test("Does not mutate the original array", () => {
test('Does not mutate the original array', () => {
shank(names, 1, 0, 'delta');
expect(names).toEqual(['alpha', 'bravo', 'charlie']);
});