Skip to content

Commit

Permalink
Change 'propertyNotVal' to 'notPropertyVal'
Browse files Browse the repository at this point in the history
The Chai docs show the method name as 'notPropertyVal':
https://www.chaijs.com/api/assert/#method_notpropertyval
  • Loading branch information
bcmarinacci committed Dec 13, 2018
1 parent a536e20 commit d814a62
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/transformers/chai-assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,11 @@ export default function transformer(fileInfo, api, options) {
return makeExpectation('toBe', j.memberExpression(obj, prop), value);
});

// assert.propertyNotVal -> expect(*.[prop]).not.toBe()
// assert.notPropertyVal -> expect(*.[prop]).not.toBe()
ast
.find(
j.CallExpression,
getAssertionExpression(chaiAssertExpression, 'propertyNotVal')
getAssertionExpression(chaiAssertExpression, 'notPropertyVal')
)
.replaceWith(path => {
const [obj, prop, value] = path.value.arguments;
Expand Down
2 changes: 1 addition & 1 deletion src/transformers/chai-assert.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const mappings = [
"expect({ tea: { green: 'matcha' }}).not.toHaveProperty('tea.oolong');",
],
['assert.propertyVal(foo, bar, baz);', 'expect(foo.bar).toBe(baz);'],
['assert.propertyNotVal(foo, bar, baz);', 'expect(foo.bar).not.toBe(baz);'],
['assert.notPropertyVal(foo, bar, baz);', 'expect(foo.bar).not.toBe(baz);'],
[
"assert.deepPropertyVal({ tea: { green: 'matcha' } }, 'tea', { green: 'matcha' });",
"expect({ tea: { green: 'matcha' } }).toHaveProperty('tea', { green: 'matcha' });",
Expand Down

0 comments on commit d814a62

Please sign in to comment.