Skip to content

Commit

Permalink
Add tests and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Xotic750 committed Aug 4, 2019
1 parent 0ec45f9 commit b1039af
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Possible values are.
**Example**

```js
import $iterator$, {getSymbolIterator(iterable)} from 'symbol-iterator-x';
import $iterator$, {getSymbolIterator} from 'symbol-iterator-x';

const array = [];

Expand Down
13 changes: 11 additions & 2 deletions __tests__/symbol-iterator-x.test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
import symIt from '../src/symbol-iterator-x';
import $iterator$, {getSymbolIterator} from '../src/symbol-iterator-x';

describe('symbol iterator', function() {
it('is a symbol or string', function() {
expect.assertions(1);
const type = typeof symIt;
const type = typeof $iterator$;
const isType = ['symbol', 'string'].some((val) => val === type);
expect(isType).toBe(true);
});

it('getSymbolIterator', function() {
expect.assertions(5);
expect(getSymbolIterator([])).toBe($iterator$);
expect(getSymbolIterator(undefined)).toBeUndefined();
expect(getSymbolIterator(null)).toBeUndefined();
expect(getSymbolIterator(1)).toBeUndefined();
expect(getSymbolIterator(true)).toBeUndefined();
});
});
4 changes: 2 additions & 2 deletions dist/symbol-iterator-x.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/symbol-iterator-x.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "symbol-iterator-x",
"version": "1.0.1",
"version": "1.0.2",
"description": "The system Symbol.iterator (real or fake)",
"homepage": "https://github.com/Xotic750/symbol-iterator-x",
"author": {
Expand Down

0 comments on commit b1039af

Please sign in to comment.