Skip to content

Commit

Permalink
update readme.md and unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
sima-milli committed Apr 30, 2020
1 parent 15ae00f commit f59f93b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ Small single [linked list.](https://en.wikipedia.org/wiki/Linked_list "linked li
## Installation

```sh
npm install structure
yarn add structure
npm install @simamilli/structure
yarn add @simamilli/structure
```

## Usage

```javascript
const {LinkedList} = require(“structure”);
const {LinkedList} = require(“@simamilli/structure”);
const structure = new LinkedList(5);

// add
Expand Down
8 changes: 8 additions & 0 deletions test/linkList.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,12 @@ describe("linkList", () => {
});
expect(newList.firstWagon.people.data).to.equal(1);
});

it("should turn linkedlist to array", () => {
const linkList = new Train();
linkList.add(1);
linkList.add(2);
const newArr = linkList.toArray();
expect(newArr).to.be.an('array');
})
});

0 comments on commit f59f93b

Please sign in to comment.