Skip to content

Commit

Permalink
bumped to v1.0.7:
Browse files Browse the repository at this point in the history
- fixes in assertion "actual" and "expected" output
    - gives clearer output for (im)mutable and truthy/falsey assertions
  • Loading branch information
sc0ttj committed Mar 9, 2020
1 parent 7f1ae0e commit 6e65d0e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions examples/simple-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ test("test using ASSERT, description here", () => {
assert.falsey("0 is falsey", 0)
assert.falsey("1 is falsey", 1)
assert.falsey("null is falsey", null, true)
assert.isMutable("Object is mutable", {foo: 10}, true)
assert.isImmutable("Number is immutable", 99, true)
assert.isMutable("Object is mutable", 10)
assert.isImmutable("Number is immutable", {foo: 99})
})

//
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scottjarvis/tea",
"version": "1.0.6",
"version": "1.0.7",
"description": "Test Environment Application",
"author": "sc0ttj",
"license": "MIT",
Expand Down
10 changes: 5 additions & 5 deletions src/tea.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,11 +487,11 @@ export default (tea = function() {
}

tea.assert.truthy = function(msg, a, b) {
return tea.assertHarness(!!a, msg, a, b, "Truthy")
return tea.assertHarness(!!a, msg, a, "truthy", "Truthy")
}

tea.assert.falsey = function(msg, a, b) {
return tea.assertHarness(!a, msg, a, b, "Falsey")
return tea.assertHarness(!a, msg, a, "falsey", "Falsey")
}

// from: react/packages/shared/ReactSymbols.js
Expand All @@ -509,7 +509,7 @@ export default (tea = function() {
}

tea.assert.isReactElement = function(msg, a, b) {
return tea.assertHarness(tea.isReactElement(a), msg, a, b, "isReactElement")
return tea.assertHarness(tea.isReactElement(a), msg, a, 'typeof ReactElement', "isReactElement")
}

// https://stackoverflow.com/questions/4402272/checking-if-data-is-immutable
Expand All @@ -518,11 +518,11 @@ export default (tea = function() {
}

tea.assert.isMutable = function(msg, a, b) {
return tea.assertHarness(tea.isMutable(a), msg, a, b, "isMutable")
return tea.assertHarness(tea.isMutable(a), msg, typeof a, 'mutable object', "isMutable")
}

tea.assert.isImmutable = function(msg, a, b) {
return tea.assertHarness(tea.isMutable(a) === false, msg, a, b, "isImmutable")
return tea.assertHarness(tea.isMutable(a) === false, msg, typeof a, 'immutable object', "isImmutable")
}

// https://vanillajstoolkit.com/helpers/diff/
Expand Down

0 comments on commit 6e65d0e

Please sign in to comment.