
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
ember-current-url
Advanced tools
High Level URL Assertions for QUnit in Ember, heavily inspired by qunit-dom.
ember install ember-current-url
Then run this codemod in you project directory order to migrate. To run the codemod:
If you do not have jscodeshift installed globally, then run: npm i jscodeshift -g
To perform the transformation run the following command:
jscodeshift -t https://raw.githubusercontent.com/dexturr/ember-current-url-codemod/master/index.js ./tests
This adds a new functionality to QUnit assert
which verifies properties of the current URL. This utaltizes a hash for the query parameters so that tests are not dependant on the order of the query parameters.
test('Basic routes', async function(assert) {
await visit('/foo');
assert.url.equals('/foo');
});
// Query params function either by using a URL
test('Query params', async function(assert) {
await visit('/foo?bar=baz&qux=quux');
assert.url.equals('/foo?bar=baz&qux=quux');
});
// Or a hash
test('Query params (hash)', async function(assert) {
await visit('/foo?bar=baz&qux=quux');
assert.url.equals(
'/foo',
{
bar: 'baz',
qux: 'quux'
}
);
});
test('Includes', async function(assert) {
await visit('/foo/bar/baz');
assert.url.includes('bar');
});
test('Does Not Include', async function(assert) {
await visit('/foo/bar/baz');
assert.url.doesNotInclude('qux');
});
test('Has query parameters', async function(assert) {
await visit('/foo?bar=baz');
assert.url.hasQueryParameters({
bar: 'baz'
});
});
test('Does not have query parameters functions', async function(assert) {
await visit('/foo?bar=baz');
assert.url.doesNotHaveQueryParameters({
qux: 'quux'
});
});
Previously assert.url
was assert.currentUrl
. Both are still supported and work as expected.
git clone <repository-url>
cd ember-current-url
npm install
In general you can just run npm build
(which runs both the below) however if altering anything in ./lib
you will need to build rollup and rebuild Ember in order to see your changes (it sucks, I know).
npm run build:dist
npm run build:ember
npm run lint:js
npm run lint:js -- --fix
ember test
– Runs the test suite on the current Ember versionember test --server
– Runs the test suite in "watch mode"ember try:each
– Runs the test suite against multiple Ember versionsember serve
For more information on using ember-cli, visit https://ember-cli.com/.
This project is licensed under the MIT License.
0.1.2
New feature:
- Change assert.currentUrl
to be assert.url
FAQs
The default blueprint for ember-cli addons.
The npm package ember-current-url receives a total of 26 weekly downloads. As such, ember-current-url popularity was classified as not popular.
We found that ember-current-url demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.