Skip to content

Commit

Permalink
fix: reinstated codemods for options on all methods
Browse files Browse the repository at this point in the history
  • Loading branch information
wheresrhys committed Sep 19, 2024
1 parent 78c2e35 commit 3a610b7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
3 changes: 1 addition & 2 deletions packages/codemods/src/__test__/option-codemods.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,7 @@ describe('codemods operating on options', () => {
`Object.assign(fetchMock.config, {fallbackToNetwork: true, other: 'value'})`,
`Object.assign(fetchMock.config, {
other: 'value'
});
${errorString}`,
})${errorString}`,
);
});
});
Expand Down
32 changes: 16 additions & 16 deletions packages/codemods/src/codemods/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,23 @@ module.exports.simpleOptions = function(fetchMockVariableName, root) {
);

[
// 'once',
// 'route',
// 'sticky',
// 'any',
// 'anyOnce',
'once',
'route',
'sticky',
'any',
'anyOnce',
'get',
// 'getOnce',
// 'post',
// 'postOnce',
// 'put',
// 'putOnce',
// 'delete',
// 'deleteOnce',
// 'head',
// 'headOnce',
// 'patch',
// 'patchOnce',
'getOnce',
'post',
'postOnce',
'put',
'putOnce',
'delete',
'deleteOnce',
'head',
'headOnce',
'patch',
'patchOnce',
].some((methodName) => {
const optionsObjects = fetchMockMethodCalls
.filter((path) => path.value.callee.property.name === methodName)
Expand Down

0 comments on commit 3a610b7

Please sign in to comment.