Skip to content
This repository

Fixes to ensure that tests run #20

Closed
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 commented June 29, 2012

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 June 29, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
2  lib/sql.js
@@ -17,7 +17,7 @@
17 17
 // limitations under the License.
18 18
 //---------------------------------------------------------------------------------------------------------------------------------
19 19
 
20  
-var sql = require('./sqlserver.node');
  20
+var sql = require('./sqlserver.native');
21 21
 var events = require('events');
22 22
 var util = require('util');
23 23
 
31  lib/sqlserver.native.js
... ...
@@ -0,0 +1,31 @@
  1
+//---------------------------------------------------------------------------------------------------------------------------------
  2
+// File: sqlserver.native.js
  3
+// Contents: javascript which loads the native part of the Microsoft Driver for Node.js for SQL Server
  4
+// 
  5
+// Copyright Microsoft Corporation
  6
+//
  7
+// Licensed under the Apache License, Version 2.0 (the "License");
  8
+// you may not use this file except in compliance with the License.
  9
+//
  10
+// You may obtain a copy of the License at:
  11
+// http://www.apache.org/licenses/LICENSE-2.0
  12
+//
  13
+// Unless required by applicable law or agreed to in writing, software
  14
+// distributed under the License is distributed on an "AS IS" BASIS,
  15
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16
+// See the License for the specific language governing permissions and
  17
+// limitations under the License.
  18
+//---------------------------------------------------------------------------------------------------------------------------------
  19
+
  20
+try {
  21
+    module.exports = require('./sqlserver.node');        
  22
+}
  23
+catch (e) {
  24
+    try {
  25
+	    module.exports = require('../build/Release/sqlserver.node');
  26
+    }
  27
+    catch (e) {
  28
+        console.error('Native sqlserver module not found. Did you remember to run node-gyp configure build?');
  29
+        throw e;
  30
+    }
  31
+}
2  test/runtests.js
@@ -47,4 +47,4 @@ files.forEach(function (file) {
47 47
   }
48 48
 });
49 49
 
50  
-require( config.mocha );
  50
+require('mocha/bin/mocha');
3  test/test-config.js
@@ -4,6 +4,3 @@
4 4
 exports.server = '.\\SQL2008R2';
5 5
 exports.user = '<user>';
6 6
 exports.pwd = '<pwd>';
7  
-
8  
-// location of mocha module
9  
-exports.mocha = '../../node_modules/mocha/bin/mocha';
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.