async testConnection() { // eslint-disable-next-line no-underscore-dangle const conn = await this.pool._factory.create(); try { return await conn.execute('SELECT 1'); } finally { // eslint-disable-next-line no-underscore-dangle await this.pool._factory.destroy(conn); } }
/** * @api {delete} /api/v1/dashboard/:dashboard_selector delete * @apiName delete * @apiGroup Dashboard * */ async function destroy(req, res) { await gladys.dashboard.destroy(req.params.dashboard_selector); res.json({ success: true, }); }
test('works with integer', () => { const gpu = new GPU({ mode: 'dev' }); const kernel = gpu.createKernel(function(value) { return value; }, { output: [1] }); assert.deepEqual(kernel(1), new Float32Array([1])); gpu.destroy(); });
selectAndDestroy(pos) { pos = (pos === undefined) ? this.state.currentIndex : pos; // handle onChange if (pos !== this.state.origIndex) { this.props.onChange(this.availOptionEls[pos].index); } // close menu this.destroy(); }
function multiplication(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function() { return 3 * 2; }, { output: [1] }); const result = kernel(); assert.equal(result[0], 3 * 2); gpu.destroy(); }
this.config.database.destroy('_Installation', delQuery).then(() => { return deviceTokenMatches[0]['objectId']; }).catch(err => { if (err.code == Parse.Error.OBJECT_NOT_FOUND) { // no deletions were made. Can be ignored return; } // rethrow the error throw err; })
describe('calendar.destroy', () => { const calendar = new Calendar(); it('should destroy a calendar', async () => { await calendar.destroy('test-calendar'); }); it('should return calendar not found', async () => { const promise = calendar.destroy('not-found-calendar'); return assert.isRejected(promise, 'Calendar not found'); }); });
componentWillReceiveProps(nextProps) { if (nextProps.newProfilePicture !== this.props.newProfilePicture) { this.cropper.destroy(); this.initCropper(); } }
test('works with input array', () => { const gpu = new GPU({ mode: 'dev' }); const kernel = gpu.createKernel(function(value) { return value[this.thread.x]; }, { output: [4] }); assert.deepEqual(kernel(input([1,2,3,4], [4])), new Float32Array([1,2,3,4])); gpu.destroy(); });
/** * @api {delete} /api/v1/room/:room_selector delete * @apiName delete * @apiGroup Room * */ async function destroy(req, res) { await gladys.room.destroy(req.params.room_selector); res.json({ success: true, }); }
function decrementEarlyReturn(mode) { const gpu = new GPU({ mode }); const kernel = gpu.createKernel(function() { let i = 3; return i--; }, { output: [1] }); const result = kernel(); let i = 3; assert.equal(result[0], i--); gpu.destroy(); }
test('works with float', () => { const gpu = new GPU({ mode: 'dev' }); const kernel = gpu.createKernel(function(value) { return value; }, { output: [1] }); assert.deepEqual(kernel(1.5), new Float32Array([1.5])); gpu.destroy(); });
componentWillReceiveProps(nextProps) { if (nextProps.newProfilePicture !== this.props.newProfilePicture) { this.cropper.destroy(); this.initCropper(); } }
/** * @api {delete} /api/v1/dashboard/:dashboard_selector delete * @apiName delete * @apiGroup Dashboard * */ async function destroy(req, res) { await gladys.dashboard.destroy(req.params.dashboard_selector); res.json({ success: true, }); }