Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include query string in MatchPattern URL test #2732

Merged
merged 6 commits into from
Dec 1, 2017
Merged

Include query string in MatchPattern URL test #2732

merged 6 commits into from
Dec 1, 2017

Conversation

NoneGiven
Copy link
Contributor

Super simple fix prescribed by @arantius, fixes #2715.

Tested with this branch loaded as a temporary webext in FF 57 and it does indeed fix the issue (obviously).

@arantius arantius added this to the 4.1 milestone Nov 28, 2017
@arantius
Copy link
Collaborator

Please include a unit test.

@NoneGiven
Copy link
Contributor Author

NoneGiven commented Nov 28, 2017

Added unit test.

Without fix:

Firefox 57.0.0 (Windows 7 0.0.0) bg/user-script-registry match pattern respects query string FAILED
        expected 'lowlight' to equal 'highlight'
        AssertionError@node_modules/chai/chai.js:9320:13
        [3]</module.exports/Assertion.prototype.assert@node_modules/chai/chai.js:239:13
        [6]</module.exports/assert.equal@node_modules/chai/chai.js:4218:5
        @test/bg/user-script-registry.test.js:50:5

Firefox 57.0.0 (Windows 7 0.0.0): Executed 28 of 28 (1 FAILED) (0.609 secs / 0.568 secs)

With fix:

Firefox 57.0.0 (Windows 7 0.0.0): Executed 28 of 28 SUCCESS (0.617 secs / 0.585 secs)

@@ -31,4 +31,27 @@ describe('bg/user-script-registry', () => {
});
});
});

it('match pattern respects query string', async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of it('match pattern ..., this should be a test of MatchPattern.doMatch() directly. That's the code you're changing. And it would also need less setup code, tested that way.

Copy link
Contributor Author

@NoneGiven NoneGiven Nov 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I add a test/third-party directory and MatchPattern.test.js file then?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

@NoneGiven
Copy link
Contributor Author

Added doMatch unit test.

@arantius
Copy link
Collaborator

arantius commented Dec 1, 2017

Great! Thanks for all the updates!

@arantius arantius merged commit 362db69 into greasemonkey:master Dec 1, 2017
@NoneGiven NoneGiven deleted the matchpattern-querystring branch December 2, 2017 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@Match problem (not ports)
2 participants