.then(() => { td.verify(ga('create', captor.capture()), { ignoreExtraArgs: true }); td.verify(ga('send', 'pageview', captor.capture())); assert.strictEqual(captor.values[0], expectedId); assert.strictEqual(captor.values[1].page, expectedPath); done(); })
.then(() => { for (const key of Object.keys(expectedObj)) { const expected = expectedObj[key]; assert.strictEqual(sush.stock.get(key), expected); } done(); })
setTimeout(() => { assert.strictEqual(dispatched.length, 3); nodeAssert.deepStrictEqual(dispatched[0], { type: WorkerPostEventType.INITIALIZED, payload: { base: 1, test: 1, test2: 1, test3: 0, }, }); nodeAssert.deepStrictEqual(dispatched[1], { type: WorkerPostEventType.UPDATE, payload: { base: 2, test: 2, test2: 1, test3: 1, }, }); nodeAssert.deepStrictEqual(dispatched[2], { type: WorkerPostEventType.DISPATCHED, payload: { type: 'test', payload: 1 }, }); done(); }, WAIT_TIME_MS);
it('returns lower-case if mode is \'lower\'', () => { const expected = 'lowercase'; const key = 'LOWERCASE'; stock = new Stock({ mode: 'lower' }); const actual = (stock as any)._convertKey(key); assert.strictEqual(actual, expected); });
it('returns unchanged string if mode is \'default\'', () => { const expected = 'SOMEthing'; const key = 'SOMEthing'; stock = new Stock(); const actual = (stock as any)._convertKey(key); assert.strictEqual(actual, expected); });
it('should have the same properties as the input', () => { assert.strictEqual(twix.config.consumerKey, config.consumerKey); assert.strictEqual(twix.config.consumerSecret, config.consumerSecret); assert.strictEqual(twix.config.accessToken, config.accessToken); assert.strictEqual(twix.config.accessTokenSecret, config.accessTokenSecret); });
.then(() => { assert.strictEqual(sush.stock.get('example'), 'https://example.com'); assert.strictEqual(sush.stock.get('google'), 'https://google.com'); done(); })
it('returns false if value has NOT been associated to key', () => { const actual = stock.has('nonekey'); assert.strictEqual(actual, false); });
it('returns true if value has been associated to key', () => { const actual = stock.has('somekey'); assert.strictEqual(actual, true); });
it('passes \'default\' as mode to Store if mode is none', () => { const expected = 'default'; const sush = new SUSH(); const actual = sush.stock.mode; assert.strictEqual(actual, expected); });