Skip to content

Loading…

Fixes to ensure that tests run #20

Closed
wants to merge 4 commits into from

2 participants

@einaros

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

@jkint jkint was assigned
@jkint

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!

@jkint jkint closed this
@jkint 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. @einaros

    corrected compiled module path

    einaros committed
  2. @einaros

    corrected mocha bin path

    einaros committed
  3. @einaros
  4. @einaros

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

    einaros committed
    …he same spot as per package.json
Showing with 33 additions and 5 deletions.
  1. +1 −1 lib/sql.js
  2. +31 −0 lib/sqlserver.native.js
  3. +1 −1 test/runtests.js
  4. +0 −3 test/test-config.js
View
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');
View
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:
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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;
+ }
+}
View
2 test/runtests.js
@@ -47,4 +47,4 @@ files.forEach(function (file) {
}
});
-require( config.mocha );
+require('mocha/bin/mocha');
View
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.