diff --git a/README.md b/README.md index b9221cc..09945b4 100644 --- a/README.md +++ b/README.md @@ -524,7 +524,7 @@ module('basic acceptance test', function(hooks) { test('can visit /', async function(assert) { await visit('/'); - assert.equal(currentURL(), '/'); + assert.strictEqual(currentURL(), '/'); }); }); diff --git a/tests/helpers/storage.js b/tests/helpers/storage.js index 621e231..f0874a8 100644 --- a/tests/helpers/storage.js +++ b/tests/helpers/storage.js @@ -1,6 +1,6 @@ function storageEqual(assert, actual, expected, message) { actual = actual ? JSON.parse(actual) : undefined; - assert.equal(actual, expected, message); + assert.strictEqual(actual, expected, message); } function storageDeepEqual(assert, actual, expected, message) { diff --git a/tests/unit/array-test.js b/tests/unit/array-test.js index 90572eb..7f5594f 100644 --- a/tests/unit/array-test.js +++ b/tests/unit/array-test.js @@ -39,8 +39,8 @@ module('array - likes', function (hooks) { test('it has correct defaults', function (assert) { assert.expect(3); - assert.equal(get(subject, 'anonymousLikes._storageType'), 'local'); - assert.equal( + assert.strictEqual(get(subject, 'anonymousLikes._storageType'), 'local'); + assert.strictEqual( get(subject, 'anonymousLikes._storageKey'), 'storage:anonymous-likes' ); @@ -129,7 +129,7 @@ module('array - likes', function (hooks) { run(function () { get(subject, 'postLikes').clear(); }); - assert.equal(window.localStorage['storage:post-likes'], undefined); + assert.strictEqual(window.localStorage['storage:post-likes'], undefined); }); test('after .clear() the array works as expected', function (assert) { @@ -145,7 +145,7 @@ module('array - likes', function (hooks) { run(function () { get(subject, 'postLikes').clear(); }); - assert.equal(window.localStorage['storage:post-likes'], undefined); + assert.strictEqual(window.localStorage['storage:post-likes'], undefined); run(function () { get(subject, 'postLikes').addObject('martin'); diff --git a/tests/unit/helpers/import-export-test.js b/tests/unit/helpers/import-export-test.js index 1ffe7da..4951bf9 100644 --- a/tests/unit/helpers/import-export-test.js +++ b/tests/unit/helpers/import-export-test.js @@ -35,8 +35,8 @@ module('Unit | Helpers | import/export', function (hooks) { }); }) .then(function (data) { - assert.equal(get(data.posts, 'length'), 2); - assert.equal(get(data.comments, 'length'), 3); + assert.strictEqual(get(data.posts, 'length'), 2); + assert.strictEqual(get(data.comments, 'length'), 3); }); }); @@ -60,8 +60,8 @@ module('Unit | Helpers | import/export', function (hooks) { }); }) .then(function (data) { - assert.equal(get(data.posts, 'length'), 2); - assert.equal(get(data.comments, 'length'), 3); + assert.strictEqual(get(data.posts, 'length'), 2); + assert.strictEqual(get(data.comments, 'length'), 3); }); }); @@ -84,13 +84,13 @@ module('Unit | Helpers | import/export', function (hooks) { }); }) .then(function (data) { - assert.equal(get(data.posts, 'length'), 2); - assert.equal(get(data.comments, 'length'), 3); - assert.equal( + assert.strictEqual(get(data.posts, 'length'), 2); + assert.strictEqual(get(data.comments, 'length'), 3); + assert.strictEqual( JSON.parse(window.localStorage['index-comments']).length, 3 ); - assert.equal( + assert.strictEqual( JSON.parse(window.sessionStorage['index-posts']).length, 2 ); @@ -117,7 +117,7 @@ module('Unit | Helpers | import/export', function (hooks) { return exportData(store, ['posts', 'comments'], { json: false }); }) .then(function (data) { - assert.equal(data.data.length, 5); + assert.strictEqual(data.data.length, 5); }); }); @@ -142,7 +142,7 @@ module('Unit | Helpers | import/export', function (hooks) { return exportData(store, ['posts', 'comments'], { json: false }); }) .then(function (data) { - assert.equal(data.data.length, 5); + assert.strictEqual(data.data.length, 5); }); }); }); diff --git a/tests/unit/models/blog/post-test.js b/tests/unit/models/blog/post-test.js index bcbeb36..ab73cb0 100644 --- a/tests/unit/models/blog/post-test.js +++ b/tests/unit/models/blog/post-test.js @@ -18,7 +18,7 @@ module('Unit | Model | blog/post', function (hooks) { let posts = store.findAll('blog/post'); - assert.equal(get(posts, 'length'), 0); + assert.strictEqual(get(posts, 'length'), 0); run(function () { store.createRecord('blog/post', { name: 'Super Name' }).save(); @@ -27,7 +27,7 @@ module('Unit | Model | blog/post', function (hooks) { }); store.findAll('blog/post').then(function (posts) { - assert.equal(get(posts, 'length'), 3); + assert.strictEqual(get(posts, 'length'), 3); done(); }); }); @@ -39,7 +39,7 @@ module('Unit | Model | blog/post', function (hooks) { let posts = store.findAll('blog/post'); - assert.equal(get(posts, 'length'), 0); + assert.strictEqual(get(posts, 'length'), 0); run(function () { store.push({ @@ -59,7 +59,7 @@ module('Unit | Model | blog/post', function (hooks) { }); store.findAll('blog/post').then(function (posts) { - assert.equal(get(posts, 'length'), 2); + assert.strictEqual(get(posts, 'length'), 2); done(); }); }); @@ -81,8 +81,11 @@ module('Unit | Model | blog/post', function (hooks) { run(function () { store.findRecord('blog/post', get(newPost, 'id')).then(function (post) { - assert.equal(get(post, 'id'), get(newPost, 'id')); - assert.equal(get(post, 'name'), 'Ember.js: 10 most common mistakes'); + assert.strictEqual(get(post, 'id'), get(newPost, 'id')); + assert.strictEqual( + get(post, 'name'), + 'Ember.js: 10 most common mistakes' + ); done(); }); }); @@ -94,7 +97,7 @@ module('Unit | Model | blog/post', function (hooks) { const store = this.owner.lookup('service:store'); let posts = store.findAll('blog/post'); - assert.equal(get(posts, 'length'), 0); + assert.strictEqual(get(posts, 'length'), 0); run(function () { store @@ -111,7 +114,7 @@ module('Unit | Model | blog/post', function (hooks) { }); store.findAll('blog/post').then(function (posts) { - assert.equal(get(posts, 'length'), 2); + assert.strictEqual(get(posts, 'length'), 2); done(); }); }); @@ -122,7 +125,7 @@ module('Unit | Model | blog/post', function (hooks) { const store = this.owner.lookup('service:store'); let posts = store.findAll('blog/post'); - assert.equal(get(posts, 'length'), 0); + assert.strictEqual(get(posts, 'length'), 0); run(function () { store @@ -145,13 +148,13 @@ module('Unit | Model | blog/post', function (hooks) { }); store.findAll('blog/post').then(function (posts) { - assert.equal(get(posts, 'length'), 3); + assert.strictEqual(get(posts, 'length'), 3); }); store .queryRecord('blog/post', { filter: { name: 'Super Name' } }) .then(function (post) { - assert.equal(get(post, 'name'), 'Super Name'); + assert.strictEqual(get(post, 'name'), 'Super Name'); done(); }); }); diff --git a/tests/unit/models/post-test.js b/tests/unit/models/post-test.js index c7f814b..38a89e0 100644 --- a/tests/unit/models/post-test.js +++ b/tests/unit/models/post-test.js @@ -34,7 +34,7 @@ module('Unit | Model | post', function (hooks) { let posts = store.findAll('post'); - assert.equal(get(posts, 'length'), 0); + assert.strictEqual(get(posts, 'length'), 0); run(function () { store.createRecord('post', { name: 'Super Name' }).save(); @@ -43,7 +43,7 @@ module('Unit | Model | post', function (hooks) { }); store.findAll('post').then(function (posts) { - assert.equal(get(posts, 'length'), 3); + assert.strictEqual(get(posts, 'length'), 3); done(); }); }); @@ -55,7 +55,7 @@ module('Unit | Model | post', function (hooks) { let posts = store.findAll('post'); - assert.equal(get(posts, 'length'), 0); + assert.strictEqual(get(posts, 'length'), 0); run(function () { store.push({ @@ -75,7 +75,7 @@ module('Unit | Model | post', function (hooks) { }); store.findAll('post').then(function (posts) { - assert.equal(get(posts, 'length'), 2); + assert.strictEqual(get(posts, 'length'), 2); done(); }); }); @@ -97,8 +97,11 @@ module('Unit | Model | post', function (hooks) { run(function () { store.findRecord('post', get(newPost, 'id')).then(function (post) { - assert.equal(get(post, 'id'), get(newPost, 'id')); - assert.equal(get(post, 'name'), 'Ember.js: 10 most common mistakes'); + assert.strictEqual(get(post, 'id'), get(newPost, 'id')); + assert.strictEqual( + get(post, 'name'), + 'Ember.js: 10 most common mistakes' + ); done(); }); }); @@ -110,7 +113,7 @@ module('Unit | Model | post', function (hooks) { const store = this.owner.lookup('service:store'); let posts = store.findAll('post'); - assert.equal(get(posts, 'length'), 0); + assert.strictEqual(get(posts, 'length'), 0); run(function () { store @@ -127,7 +130,7 @@ module('Unit | Model | post', function (hooks) { }); store.findAll('post').then(function (posts) { - assert.equal(get(posts, 'length'), 2); + assert.strictEqual(get(posts, 'length'), 2); done(); }); }); @@ -138,7 +141,7 @@ module('Unit | Model | post', function (hooks) { const store = this.owner.lookup('service:store'); let posts = store.findAll('post'); - assert.equal(get(posts, 'length'), 0); + assert.strictEqual(get(posts, 'length'), 0); let paul; @@ -173,13 +176,13 @@ module('Unit | Model | post', function (hooks) { }); store.findAll('post').then(function (posts) { - assert.equal(get(posts, 'length'), 3); + assert.strictEqual(get(posts, 'length'), 3); }); store .queryRecord('post', { filter: { name: 'Super Name' } }) .then(function (post) { - assert.equal(get(post, 'name'), 'Super Name'); + assert.strictEqual(get(post, 'name'), 'Super Name'); done(); }); }); @@ -190,12 +193,12 @@ module('Unit | Model | post', function (hooks) { const store = this.owner.lookup('service:store'); let posts = store.findAll('post'); - assert.equal(get(posts, 'length'), 0); + assert.strictEqual(get(posts, 'length'), 0); store .queryRecord('post', { filter: { name: 'Super Name' } }) .then(function (post) { - assert.equal(post, null); + assert.strictEqual(post, null); done(); }) @@ -222,7 +225,7 @@ module('Unit | Model | post', function (hooks) { }); store.findAll('post').then(function (posts) { - assert.equal(get(posts, 'length'), 1); + assert.strictEqual(get(posts, 'length'), 1); done(); }); }); @@ -240,7 +243,7 @@ module('Unit | Model | post', function (hooks) { }); store.findAll('post').then(function (posts) { - assert.equal(get(posts, 'length'), 1); + assert.strictEqual(get(posts, 'length'), 1); done(); }); }); @@ -259,7 +262,7 @@ module('Unit | Model | post', function (hooks) { }); store.findAll('post').then(function (posts) { - assert.equal(get(posts, 'length'), 1); + assert.strictEqual(get(posts, 'length'), 1); done(); }); }); @@ -274,7 +277,7 @@ module('Unit | Model | post', function (hooks) { let posts = store.findAll('post'); - assert.equal(get(posts, 'length'), 0); + assert.strictEqual(get(posts, 'length'), 0); run(function () { store.push({ @@ -294,7 +297,7 @@ module('Unit | Model | post', function (hooks) { }); store.findAll('post').then(function (posts) { - assert.equal(get(posts, 'length'), 2); + assert.strictEqual(get(posts, 'length'), 2); done(); }); }); @@ -319,8 +322,11 @@ module('Unit | Model | post', function (hooks) { run(function () { store.findRecord('post', get(newPost, 'id')).then(function (post) { - assert.equal(get(post, 'id'), get(newPost, 'id')); - assert.equal(get(post, 'name'), 'Ember.js: 10 most common mistakes'); + assert.strictEqual(get(post, 'id'), get(newPost, 'id')); + assert.strictEqual( + get(post, 'name'), + 'Ember.js: 10 most common mistakes' + ); done(); }); }); diff --git a/tests/unit/models/query-record-test.js b/tests/unit/models/query-record-test.js index efd41e5..a37eca5 100644 --- a/tests/unit/models/query-record-test.js +++ b/tests/unit/models/query-record-test.js @@ -53,7 +53,7 @@ module('Unit | Model | queryRecord', function (hooks) { store .queryRecord('post', { filter: { name: 'Super Name' } }) .then(function (post) { - assert.equal(get(post, 'name'), 'Super Name'); + assert.strictEqual(get(post, 'name'), 'Super Name'); }); // boolean @@ -67,21 +67,21 @@ module('Unit | Model | queryRecord', function (hooks) { store .queryRecord('post', { filter: { commentCount: 3 } }) .then(function (post) { - assert.equal(get(post, 'commentCount'), 3); + assert.strictEqual(get(post, 'commentCount'), 3); }); // regex store .queryRecord('post', { filter: { name: /^Just(.*)/ } }) .then(function (post) { - assert.equal(get(post, 'name'), 'Just awesome'); + assert.strictEqual(get(post, 'name'), 'Just awesome'); }); // camelized key store .queryRecord('post', { filter: { commentCount: 3 } }) .then(function (post) { - assert.equal(get(post, 'commentCount'), 3); + assert.strictEqual(get(post, 'commentCount'), 3); done(); }); }); @@ -135,7 +135,7 @@ module('Unit | Model | queryRecord', function (hooks) { // get first post from user '123' // string store.queryRecord('post', { filter: { user: id } }).then(function (post) { - assert.equal( + assert.strictEqual( get(post, 'name'), 'Ember.js: Testing with Ember PageObjects' ); @@ -145,7 +145,7 @@ module('Unit | Model | queryRecord', function (hooks) { store .queryRecord('post', { filter: { user: { id: id } } }) .then(function (post) { - assert.equal( + assert.strictEqual( get(post, 'name'), 'Ember.js: Testing with Ember PageObjects' ); @@ -155,7 +155,7 @@ module('Unit | Model | queryRecord', function (hooks) { store .queryRecord('post', { filter: { user: regexId } }) .then(function (post) { - assert.equal( + assert.strictEqual( get(post, 'name'), 'Ember.js: Testing with Ember PageObjects' ); @@ -165,7 +165,7 @@ module('Unit | Model | queryRecord', function (hooks) { store .queryRecord('post', { filter: { user: { id: regexId } } }) .then(function (post) { - assert.equal( + assert.strictEqual( get(post, 'name'), 'Ember.js: Testing with Ember PageObjects' ); @@ -176,20 +176,26 @@ module('Unit | Model | queryRecord', function (hooks) { store .queryRecord('post', { filter: { user: { type: 'editor' } } }) .then(function (post) { - assert.equal(get(post, 'name'), 'Ember.js: 10 most common mistakes'); + assert.strictEqual( + get(post, 'name'), + 'Ember.js: 10 most common mistakes' + ); }); // regex store .queryRecord('post', { filter: { user: { type: /^ed(.*)ors$/ } } }) .then(function (post) { - assert.equal(get(post, 'name'), 'Ember.js: 10 most common mistakes'); + assert.strictEqual( + get(post, 'name'), + 'Ember.js: 10 most common mistakes' + ); }); // get first post from editor '123' store .queryRecord('post', { filter: { user: { id: id, type: 'editor' } } }) .then(function (post) { - assert.equal( + assert.strictEqual( get(post, 'name'), 'Ember.js: Testing with Ember PageObjects', 'nuu' @@ -201,7 +207,7 @@ module('Unit | Model | queryRecord', function (hooks) { filter: { user: { id: id, type: /^ed(.*)ors$/ } }, }) .then(function (post) { - assert.equal( + assert.strictEqual( get(post, 'name'), 'Ember.js: Testing with Ember PageObjects', 'ups' @@ -266,28 +272,28 @@ module('Unit | Model | queryRecord', function (hooks) { store .queryRecord('user', { filter: { projects: id } }) .then(function (user) { - assert.equal(get(user, 'name'), 'Peter'); + assert.strictEqual(get(user, 'name'), 'Peter'); }); // object store .queryRecord('user', { filter: { projects: { id: id } } }) .then(function (user) { - assert.equal(get(user, 'name'), 'Peter'); + assert.strictEqual(get(user, 'name'), 'Peter'); }); // regex store .queryRecord('user', { filter: { projects: regexId } }) .then(function (user) { - assert.equal(get(user, 'name'), 'Peter'); + assert.strictEqual(get(user, 'name'), 'Peter'); }); // object regex store .queryRecord('user', { filter: { projects: { id: regexId } } }) .then(function (user) { - assert.equal(get(user, 'name'), 'Peter'); + assert.strictEqual(get(user, 'name'), 'Peter'); }); // polymorphic @@ -295,7 +301,7 @@ module('Unit | Model | queryRecord', function (hooks) { store .queryRecord('user', { filter: { pets: { type: 'cat' } } }) .then(function (user) { - assert.equal(get(user, 'name'), 'Anna'); + assert.strictEqual(get(user, 'name'), 'Anna'); }); // get first user with cat '123' @@ -304,7 +310,7 @@ module('Unit | Model | queryRecord', function (hooks) { filter: { pets: { id: get(cat, 'id'), type: 'cat' } }, }) .then(function (user) { - assert.equal(get(user, 'name'), 'Anna'); + assert.strictEqual(get(user, 'name'), 'Anna'); }); // get first user with cats AND dogs @@ -313,14 +319,14 @@ module('Unit | Model | queryRecord', function (hooks) { filter: { pets: [{ type: 'cat' }, { type: 'dog' }] }, }) .then(function (user) { - assert.equal(get(user, 'name'), 'Moritz'); + assert.strictEqual(get(user, 'name'), 'Moritz'); }); // get first user with cats OR dogs store .queryRecord('user', { filter: { pets: { type: /cats|dogs/ } } }) .then(function (user) { - assert.equal(get(user, 'name'), 'Anna'); + assert.strictEqual(get(user, 'name'), 'Anna'); }); // get the first user with bookPublication '123' (camelcased key) @@ -329,7 +335,7 @@ module('Unit | Model | queryRecord', function (hooks) { filter: { bookPublications: get(bookPublication, 'id') }, }) .then(function (user) { - assert.equal(get(user, 'name'), 'Peter'); + assert.strictEqual(get(user, 'name'), 'Peter'); done(); }); }); diff --git a/tests/unit/models/query-test.js b/tests/unit/models/query-test.js index 1121d0a..f2000e7 100644 --- a/tests/unit/models/query-test.js +++ b/tests/unit/models/query-test.js @@ -53,31 +53,31 @@ module('Unit | Model | query', function (hooks) { store .query('post', { filter: { name: 'Super Name' } }) .then(function (posts) { - assert.equal(get(posts, 'length'), 1); + assert.strictEqual(get(posts, 'length'), 1); }); // boolean store .query('post', { filter: { isPrivate: false } }) .then(function (posts) { - assert.equal(get(posts, 'length'), 1); + assert.strictEqual(get(posts, 'length'), 1); }); // number store.query('post', { filter: { commentCount: 3 } }).then(function (posts) { - assert.equal(get(posts, 'length'), 2); + assert.strictEqual(get(posts, 'length'), 2); }); // regex store .query('post', { filter: { name: /^Just(.*)/ } }) .then(function (posts) { - assert.equal(get(posts, 'length'), 2); + assert.strictEqual(get(posts, 'length'), 2); }); // camelized key store.query('post', { filter: { commentCount: 3 } }).then(function (posts) { - assert.equal(get(posts, 'length'), 2); + assert.strictEqual(get(posts, 'length'), 2); done(); }); }); @@ -131,26 +131,26 @@ module('Unit | Model | query', function (hooks) { // get posts from user '123' // string store.query('post', { filter: { user: id } }).then(function (posts) { - assert.equal(get(posts, 'length'), 2); + assert.strictEqual(get(posts, 'length'), 2); }); // object store .query('post', { filter: { user: { id: id } } }) .then(function (posts) { - assert.equal(get(posts, 'length'), 2); + assert.strictEqual(get(posts, 'length'), 2); }); // regex store.query('post', { filter: { user: regexId } }).then(function (posts) { - assert.equal(get(posts, 'length'), 2); + assert.strictEqual(get(posts, 'length'), 2); }); // object regex store .query('post', { filter: { user: { id: regexId } } }) .then(function (posts) { - assert.equal(get(posts, 'length'), 2); + assert.strictEqual(get(posts, 'length'), 2); }); // polymorphic @@ -158,26 +158,26 @@ module('Unit | Model | query', function (hooks) { store .query('post', { filter: { user: { type: 'editor' } } }) .then(function (posts) { - assert.equal(get(posts, 'length'), 3); + assert.strictEqual(get(posts, 'length'), 3); }); // regex store .query('post', { filter: { user: { type: /^ed(.*)ors$/ } } }) .then(function (posts) { - assert.equal(get(posts, 'length'), 3); + assert.strictEqual(get(posts, 'length'), 3); }); // get posts from editor '123' store .query('post', { filter: { user: { id: id, type: 'editor' } } }) .then(function (posts) { - assert.equal(get(posts, 'length'), 2, 'nuu'); + assert.strictEqual(get(posts, 'length'), 2, 'nuu'); }); // regex store .query('post', { filter: { user: { id: id, type: /^ed(.*)ors$/ } } }) .then(function (posts) { - assert.equal(get(posts, 'length'), 2, 'ups'); + assert.strictEqual(get(posts, 'length'), 2, 'ups'); done(); }); }); @@ -236,28 +236,28 @@ module('Unit | Model | query', function (hooks) { // get users who've contributed to project.id = 123 // string store.query('user', { filter: { projects: id } }).then(function (users) { - assert.equal(get(users, 'length'), 2); + assert.strictEqual(get(users, 'length'), 2); }); // object store .query('user', { filter: { projects: { id: id } } }) .then(function (users) { - assert.equal(get(users, 'length'), 2); + assert.strictEqual(get(users, 'length'), 2); }); // regex store .query('user', { filter: { projects: regexId } }) .then(function (users) { - assert.equal(get(users, 'length'), 2); + assert.strictEqual(get(users, 'length'), 2); }); // object regex store .query('user', { filter: { projects: { id: regexId } } }) .then(function (users) { - assert.equal(get(users, 'length'), 2); + assert.strictEqual(get(users, 'length'), 2); }); // polymorphic @@ -265,28 +265,28 @@ module('Unit | Model | query', function (hooks) { store .query('user', { filter: { pets: { type: 'cat' } } }) .then(function (users) { - assert.equal(get(users, 'length'), 2); + assert.strictEqual(get(users, 'length'), 2); }); // get users with cat '123' store .query('user', { filter: { pets: { id: get(cat, 'id'), type: 'cat' } } }) .then(function (users) { - assert.equal(get(users, 'length'), 2); + assert.strictEqual(get(users, 'length'), 2); }); // get users with cats AND dogs store .query('user', { filter: { pets: [{ type: 'cat' }, { type: 'dog' }] } }) .then(function (users) { - assert.equal(get(users, 'length'), 1); + assert.strictEqual(get(users, 'length'), 1); }); // get users with cats OR dogs store .query('user', { filter: { pets: { type: /cats|dogs/ } } }) .then(function (users) { - assert.equal(get(users, 'length'), 3); + assert.strictEqual(get(users, 'length'), 3); }); // get the users with bookPublication '123' (camelcased key) @@ -295,7 +295,7 @@ module('Unit | Model | query', function (hooks) { filter: { bookPublications: get(bookPublication, 'id') }, }) .then(function (users) { - assert.equal(get(users, 'length'), 2); + assert.strictEqual(get(users, 'length'), 2); done(); }); }); diff --git a/tests/unit/object-test.js b/tests/unit/object-test.js index 8d509da..f1f6968 100644 --- a/tests/unit/object-test.js +++ b/tests/unit/object-test.js @@ -68,14 +68,17 @@ module('object - settings', function (hooks) { test('it has correct defaults', function (assert) { assert.expect(6); - assert.equal(get(subject, 'settings._storageType'), 'local'); - assert.equal(get(subject, 'settings._storageKey'), 'storage:settings'); + assert.strictEqual(get(subject, 'settings._storageType'), 'local'); + assert.strictEqual( + get(subject, 'settings._storageKey'), + 'storage:settings' + ); assert.deepEqual(get(subject, 'settings._initialContent'), { welcomeMessageSeen: false, }); - assert.equal(get(subject, 'cache._storageType'), 'session'); - assert.equal(get(subject, 'cache._storageKey'), 'storage:cache'); + assert.strictEqual(get(subject, 'cache._storageType'), 'session'); + assert.strictEqual(get(subject, 'cache._storageKey'), 'storage:cache'); assert.deepEqual(get(subject, 'cache._initialContent'), {}); }); @@ -116,8 +119,8 @@ module('object - settings', function (hooks) { test('it does not share data', function (assert) { assert.expect(10); - assert.equal(get(subject, 'cache._storageType'), 'session'); - assert.equal(get(subject, 'cache._storageKey'), 'storage:cache'); + assert.strictEqual(get(subject, 'cache._storageType'), 'session'); + assert.strictEqual(get(subject, 'cache._storageKey'), 'storage:cache'); assert.deepEqual(get(subject, 'cache._initialContent'), {}); run(function () { @@ -126,8 +129,11 @@ module('object - settings', function (hooks) { assert.deepEqual(get(subject, 'cache.key1'), '123456'); - assert.equal(get(subject, 'localCache._storageType'), 'local'); - assert.equal(get(subject, 'localCache._storageKey'), 'storage:local-cache'); + assert.strictEqual(get(subject, 'localCache._storageType'), 'local'); + assert.strictEqual( + get(subject, 'localCache._storageKey'), + 'storage:local-cache' + ); assert.deepEqual(get(subject, 'localCache._initialContent'), {}); assert.deepEqual(get(subject, 'cache.key1'), '123456'); @@ -147,7 +153,7 @@ module('object - settings', function (hooks) { // setup testing get(subject, 'settings')._testing = true; - assert.equal(get(subject, 'settings.changeFired'), undefined); + assert.strictEqual(get(subject, 'settings.changeFired'), undefined); window.dispatchEvent( new window.StorageEvent('storage', { key: 'storage:settings', @@ -169,7 +175,7 @@ module('object - settings', function (hooks) { undefined ); - assert.equal(get(subject, 'nestedObjects.address.first'), null); + assert.strictEqual(get(subject, 'nestedObjects.address.first'), null); run(function () { get(subject, 'nestedObjects').set('address.first', { @@ -210,7 +216,7 @@ module('object - settings', function (hooks) { }); //we expect them to be present - assert.equal(get(subject, 'settings.newProp'), 'some-value'); + assert.strictEqual(get(subject, 'settings.newProp'), 'some-value'); assert.true(get(subject, 'settings.welcomeMessageSeen')); //reset @@ -266,7 +272,7 @@ module('object - settings', function (hooks) { get(subject, 'settings').clear(); }); - assert.equal(window.localStorage['storage:settings'], undefined); + assert.strictEqual(window.localStorage['storage:settings'], undefined); }); test('after .clear() the object works as expected', function (assert) { @@ -284,7 +290,7 @@ module('object - settings', function (hooks) { get(subject, 'settings').clear(); }); - assert.equal(window.localStorage['storage:settings'], undefined); + assert.strictEqual(window.localStorage['storage:settings'], undefined); run(function () { subject.set('settings.welcomeMessageSeen', true); diff --git a/tests/unit/storage-di-test.js b/tests/unit/storage-di-test.js index f8d8ba7..115bf9a 100644 --- a/tests/unit/storage-di-test.js +++ b/tests/unit/storage-di-test.js @@ -53,6 +53,6 @@ module('storageFor - DI', function (hooks) { test('DI is working in a storage', function (assert) { assert.expect(1); - assert.equal(subject.get('settings.backend.name'), 'Backend Name'); + assert.strictEqual(subject.get('settings.backend.name'), 'Backend Name'); }); }); diff --git a/tests/unit/storage-for-test.js b/tests/unit/storage-for-test.js index 35b1cae..3bcd522 100644 --- a/tests/unit/storage-for-test.js +++ b/tests/unit/storage-for-test.js @@ -58,12 +58,12 @@ module('storageFor', function (hooks) { test('it has the correct key (namespace not set)', function (assert) { assert.expect(4); - assert.equal( + assert.strictEqual( subject.get('settings._storageKey'), 'storage:settings:post:123' ); - assert.equal( + assert.strictEqual( subject.get('options._storageKey'), 'storage:options:post:123' ); @@ -82,12 +82,12 @@ module('storageFor', function (hooks) { setConfigEnvironment(this, 'namespace', true); - assert.equal( + assert.strictEqual( subject.get('settings._storageKey'), 'my-app:storage:settings:post:123' ); - assert.equal( + assert.strictEqual( subject.get('options._storageKey'), 'my-app:storage:options:post:123' ); @@ -114,12 +114,12 @@ module('storageFor', function (hooks) { setConfigEnvironment(this, 'namespace', 'custom'); - assert.equal( + assert.strictEqual( subject.get('settings._storageKey'), 'custom:storage:settings:post:123' ); - assert.equal( + assert.strictEqual( subject.get('options._storageKey'), 'custom:storage:options:post:123' ); @@ -147,12 +147,12 @@ module('storageFor', function (hooks) { setConfigEnvironment(this, 'namespace', true); setConfigEnvironment(this, 'keyDelimiter', '/'); - assert.equal( + assert.strictEqual( subject.get('settings._storageKey'), 'my-app/storage:settings:post:123' ); - assert.equal( + assert.strictEqual( subject.get('options._storageKey'), 'my-app/storage:options:post:123' );