Skip to content

Commit

Permalink
Fix tests doc strings
Browse files Browse the repository at this point in the history
Signed-off-by: Darko Draskovic <[email protected]>
  • Loading branch information
darkodraskovic committed Sep 12, 2022
1 parent c265cdf commit 388d5c0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion spec/binary-search-tree.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BinarySearchTree } from "../src/data-structures/binary-search-tree.js";

describe("Function", function () {
describe("BinarySearchTree methods", function () {
const insert = [9, 4, 6, 5, 3, 20, 20, 170, 15, 1, 25, 300, 7, 30];
const remove = [9, 300, 25, 7, 25, 9, 9, 170, 15];

Expand Down
2 changes: 1 addition & 1 deletion spec/graph.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { bfs, dfs } from "../src/algorithms/graph.js";

describe("Function", function () {
describe("Graph search algorithms", function () {
const connectedGraph = [
[2, 6, 10], // 0
[3, 7, 8, 9], // 1
Expand Down
4 changes: 3 additions & 1 deletion spec/search.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
BinarySearchTree
} from '../src/data-structures/binary-search-tree.js'

describe("Function", function () {
describe("BST search that ", function () {
const values = [9, 4, 6, 20, 170, 15, 1];
const bfs = [9, 4, 20, 1, 6, 15, 170];
const dfs = [9, 4, 1, 6, 20, 15, 170];
Expand All @@ -14,4 +14,6 @@ describe("Function", function () {
});
expect(tree.bfs()).toEqual(bfs);
});

// TODO: write preorder, inorder and postorder traverse tests
});
8 changes: 4 additions & 4 deletions spec/sort.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
bubbleSort, selectionSort, insertionSort, mergeSort, quickSort
} from '../src/algorithms/sort.js'

describe("Function", function () {
describe("Sort functions:", function () {
const left = [1, 2, 5, 6, 44, 99];
const right = [0, 4, 63, 87, 283];

Expand Down Expand Up @@ -32,20 +32,20 @@ describe("Function", function () {
let sortFuncs = [bubbleSort, selectionSort, insertionSort];
for (let i = 0; i < sortFuncs.length; i++) {
const func = sortFuncs[i];
it(func.name + " which sorts numbers", function () {
it(func.name + " sorts numbers", function () {
let numbers = createNumbers();
func(numbers);
expect(numbers).toEqual(sorted);
});
}

it(mergeSort.name + " which sorts numbers", function () {
it(mergeSort.name + " sorts numbers", function () {
let numbers = createNumbers();
numbers = mergeSort(numbers);
expect(numbers).toEqual(sorted);
});

it(quickSort.name + " which sorts numbers", function () {
it(quickSort.name + " sorts numbers", function () {
let numbers = createNumbers();
quickSort(numbers, 0, numbers.length - 1);
expect(numbers).toEqual(sorted);
Expand Down

0 comments on commit 388d5c0

Please sign in to comment.