Skip to content

Commit

Permalink
Merge pull request #7 from hckrnews/feature/first-draft
Browse files Browse the repository at this point in the history
Cleanup tests
  • Loading branch information
w3nl authored Oct 5, 2021
2 parents 2aa8322 + f63a70a commit baf6f2a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ encoding.test // 'TEXT'
encoding.another // 42
encoding.length // 2

encoding.is(Encoding.test) // true
encoding.is('TEXT') // true
encoding.is(42) // false
encoding.in([Encoding.test]) // true
encoding.in(['TEXT']) // true
encoding.in([42]) // false

Expand Down
4 changes: 2 additions & 2 deletions 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,7 +1,7 @@
{
"name": "@hckrnews/enum",
"description": "Create vanilla JavaScript enums",
"version": "1.3.0",
"version": "1.3.1",
"author": {
"name": "Pieter Wigboldus",
"url": "https://hckr.news/"
Expand Down
10 changes: 5 additions & 5 deletions src/__tests__/enum.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ describe('Test the encoding enum', () => {
expect(encoding.keys).toEqual(['utf-8'])
expect(encoding['utf-8']).toEqual('UTF-8')
expect(encoding.length).toEqual(1)
expect(encoding.is(Encoding.options['utf-8'])).toEqual(true)
expect(encoding.is(Encoding['utf-8'])).toEqual(true)
expect(encoding.is('UTF-8')).toEqual(true)
expect(encoding.is('something')).toEqual(false)
expect(encoding.in([Encoding.options['utf-8']])).toEqual(true)
expect(encoding.in([Encoding['utf-8']])).toEqual(true)
expect(encoding.in(['UTF-8'])).toEqual(true)
expect(encoding.in(['something'])).toEqual(false)
})
Expand Down Expand Up @@ -148,7 +148,7 @@ describe('Test the encoding enum', () => {
expect(example.keys).toEqual(['in'])
expect(example.in).toEqual(42)
expect(example.length).toEqual(1)
expect(example.is(Example.options.in)).toEqual(true)
expect(example.is(Example.in)).toEqual(true)
expect(example.is(42)).toEqual(true)
expect(example.is('something')).toEqual(false)
})
Expand Down Expand Up @@ -212,10 +212,10 @@ describe('Test the encoding enum', () => {
expect(example.keys).toEqual(['test1', 'test2', 'test3'])
expect(example.test2).toEqual(2)
expect(example.length).toEqual(3)
expect(example.is(Example.options.test2)).toEqual(true)
expect(example.is(Example.test2)).toEqual(true)
expect(example.is(2)).toEqual(true)
expect(example.is('something')).toEqual(false)
expect(example.in([Example.options.test2])).toEqual(true)
expect(example.in([Example.test2])).toEqual(true)
expect(example.in([2])).toEqual(true)
expect(example.in(['something'])).toEqual(false)
})
Expand Down

0 comments on commit baf6f2a

Please sign in to comment.