Skip to content

Commit

Permalink
Extended tests
Browse files Browse the repository at this point in the history
Signed-off-by: Jaid <jaid.jsx@gmail.com>
  • Loading branch information
Jaid committed Jul 4, 2019
1 parent 7c0d097 commit 2ffc967
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import path from "path"

const indexModule = (process.env.MAIN ? path.resolve(process.env.MAIN) : path.join(__dirname, "..", "src")) |> require
const {default: hasContent} = indexModule

/**
* @type { import("../src") }
*/
const {default: hasContent, isEmpty} = indexModule

it("should run", () => {
expect(null |> hasContent).toBe(false)
Expand All @@ -24,4 +28,9 @@ it("should run", () => {
expect([] |> hasContent).toBe(false)
expect([,] |> hasContent).toBe(true) // eslint-disable-line
expect([1] |> hasContent).toBe(true)
})

it("should run isEmpty", () => {
expect(null |> isEmpty).toBe(true)
expect("abc" |> isEmpty).toBe(false)
})

0 comments on commit 2ffc967

Please sign in to comment.