Skip to content

Commit 74e8a63

Browse files
Fix JSON spec (#119)
We were checking for specific text in the JSONParseError, but when json was updated, the message changed. We really only care that there was a JSON parse error so we're shortening the string we're checking. This change will make it so we don't run into this error again in future version updates.
1 parent 259d602 commit 74e8a63

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spec/lib/code_ownership/private/ownership_mappers/js_package_ownership_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module CodeOwnership
1717
it 'lets the user know the their package JSON is invalid' do
1818
expect { CodeOwnership.validate! }.to raise_error do |e|
1919
expect(e).to be_a CodeOwnership::InvalidCodeOwnershipConfigurationError
20-
expect(e.message).to match(/JSON::ParserError.*?unexpected token/)
20+
expect(e.message).to match(/JSON::ParserError/)
2121
expect(e.message).to include 'frontend/javascripts/my_package/package.json has invalid JSON, so code ownership cannot be determined.'
2222
expect(e.message).to include 'Please either make the JSON in that file valid or specify `js_package_paths` in config/code_ownership.yml.'
2323
end

0 commit comments

Comments
 (0)