How to use the tedious.ISOLATION_LEVEL function in tedious

To help you get started, we’ve selected a few tedious examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sequelize / sequelize / test / unit / dialects / mssql / query.js View on Github external
'use strict';

const path = require('path');
const Query = require(path.resolve('./lib/dialects/mssql/query.js'));
const Support = require(path.resolve('./test/support'));
const sequelize = Support.sequelize;
const sinon = require('sinon');
const expect = require('chai').expect;
const tedious = require('tedious');
const tediousIsolationLevel = tedious.ISOLATION_LEVEL;
const connectionStub = { beginTransaction: () => {}, lib: tedious };

let sandbox, query;

describe('[MSSQL]', () => {
  describe('beginTransaction', () => {
    beforeEach(() => {
      sandbox = sinon.sandbox.create();
      const options = {
        transaction: { name: 'transactionName' },
        isolationLevel: 'REPEATABLE_READ',
        logging: false
      };
      sandbox.stub(connectionStub, 'beginTransaction').callsFake(cb => {
        cb();
      });