Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Fixes to ensure that tests run #20

wants to merge 4 commits into from

2 participants

Einar Otto Stangvik Jay Kint
Einar Otto Stangvik

Updated mocha bin path and corrected the reference to sqlserver.node.

Jay Kint jkint was assigned
Jay Kint

Since we put all active development on our develop branch, I cherry picked these directly into the branch and squashed them down to 2 commits.

Also, updated the CONTRIBUTORS file to reflect these additions.

8c15139 - Failsafe for sqlserver.node native module require
7472deb - Removed mocha config option
82fe7d3 - Add Einar Otto Stangvik as a contributor

Thanks again for making node-sqlserver a better product!

Jay Kint jkint closed this
Jay Kint jkint was unassigned by einaros
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 11, 2012
  1. Einar Otto Stangvik

    corrected compiled module path

    einaros authored
  2. Einar Otto Stangvik

    corrected mocha bin path

    einaros authored
  3. Einar Otto Stangvik
  4. Einar Otto Stangvik

    removed mocha config option, since this will always be installed to t…

    einaros authored
    …he same spot as per package.json
This page is out of date. Refresh to see the latest.
2  lib/sql.js
@@ -17,7 +17,7 @@
// limitations under the License.
-var sql = require('./sqlserver.node');
+var sql = require('./sqlserver.native');
var events = require('events');
var util = require('util');
31 lib/sqlserver.native.js
@@ -0,0 +1,31 @@
+// File: sqlserver.native.js
+// Contents: javascript which loads the native part of the Microsoft Driver for Node.js for SQL Server
+// Copyright Microsoft Corporation
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at:
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+try {
+ module.exports = require('./sqlserver.node');
+catch (e) {
+ try {
+ module.exports = require('../build/Release/sqlserver.node');
+ }
+ catch (e) {
+ console.error('Native sqlserver module not found. Did you remember to run node-gyp configure build?');
+ throw e;
+ }
2  test/runtests.js
@@ -47,4 +47,4 @@ files.forEach(function (file) {
-require( config.mocha );
3  test/test-config.js
@@ -4,6 +4,3 @@
exports.server = '.\\SQL2008R2';
exports.user = '<user>';
exports.pwd = '<pwd>';
-// location of mocha module
-exports.mocha = '../../node_modules/mocha/bin/mocha';
Something went wrong with that request. Please try again.