diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d0c674a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: node_js -sudo: false - -services: - - mysql - - postgresql - -node_js: - - "node" - - "5" - - "4" - -before_install: - - npm install -g gulp codeclimate-test-reporter - - psql -c 'DROP DATABASE IF EXISTS test;' -U postgres - - psql -c 'create database test;' -U postgres - - mysql -e 'create database IF NOT EXISTS test;' - - mysql -v -uroot test < ./test/sql/mysql.sql - - psql test postgres -f ./test/sql/pgsql.sql - -script: gulp test - -after_script: - - CODECLIMATE_REPO_TOKEN=aa39789a53f6f8fd84747a98968c9f79795e890d55a533daa943b1042f81687f codeclimate-test-reporter < coverage/lcov.info \ No newline at end of file diff --git a/README.md b/README.md index e0e5b3c..19cc883 100755 --- a/README.md +++ b/README.md @@ -3,9 +3,6 @@ A node query builder for various SQL databases, based on [CodeIgniter](http://www.codeigniter.com/user_guide/database/query_builder.html)'s query builder. [![Build Status](https://jenkins.timshomepage.net/buildStatus/icon?job=node-query)](https://jenkins.timshomepage.net/job/node-query/) -[![Build Status](https://travis-ci.org/timw4mail/node-query.svg?branch=master)](https://travis-ci.org/timw4mail/node-query) -[![Code Climate](https://codeclimate.com/github/timw4mail/node-query/badges/gpa.svg)](https://codeclimate.com/github/timw4mail/node-query) -[![Test Coverage](https://codeclimate.com/github/timw4mail/node-query/badges/coverage.svg)](https://codeclimate.com/github/timw4mail/node-query/coverage) ### Features * Callback and Promise API for making database calls. diff --git a/lib/Result.js b/lib/Result.js index bbcccc1..7f0b185 100644 --- a/lib/Result.js +++ b/lib/Result.js @@ -1,7 +1,6 @@ 'use strict'; const helpers = require('./helpers'); -const getArgs = require('getargs'); /** * Query result object diff --git a/package.json b/package.json index ad608da..a158f63 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,8 @@ }, "license": "MIT", "scripts": { + "predocs": "documentation build -f md -o API.md lib/*.js", + "docs": "documentation build -f html -o docs lib/*.js", "test": "gulp test" } } diff --git a/test/adapters/dblite_test.js b/test/adapters/dblite_test.js index eb1d505..f90ae30 100644 --- a/test/adapters/dblite_test.js +++ b/test/adapters/dblite_test.js @@ -11,8 +11,7 @@ const testRunner = testBase.testRunner; let tests = reload('../base/tests'); // Load the test config file -const configFile = (process.env.TRAVIS) ? '../config-travis.json' : '../config.json'; -const config = reload(configFile); +const config = testBase.config; // Set up the query builder object let nodeQuery = require('../../lib/NodeQuery')(config.dblite); diff --git a/test/adapters/mysql2_test.js b/test/adapters/mysql2_test.js index 34b2fd9..5197d3e 100644 --- a/test/adapters/mysql2_test.js +++ b/test/adapters/mysql2_test.js @@ -1,7 +1,5 @@ 'use strict'; -const configFile = (process.env.TRAVIS) ? '../config-travis.json' : '../config.json'; - // Load the test base const reload = require('require-reload')(require); reload.emptyCache(); @@ -11,8 +9,8 @@ const promiseTestRunner = testBase.promiseTestRunner; const testRunner = testBase.testRunner; // Load the test config file -let adapterName = 'mysql2'; -let config = reload(configFile)[adapterName]; +// let adapterName = 'mysql2'; +const config = testBase.config[adapterName]; // Set up the query builder object let nodeQuery = reload('../../lib/NodeQuery')(config); diff --git a/test/adapters/pg_test.js b/test/adapters/pg_test.js index 639e880..c701685 100644 --- a/test/adapters/pg_test.js +++ b/test/adapters/pg_test.js @@ -1,7 +1,5 @@ 'use strict'; -let configFile = (process.env.CI) ? '../config-travis.json' : '../config.json'; - // Load the test base const reload = require('require-reload')(require); reload.emptyCache(); @@ -12,8 +10,8 @@ const testRunner = testBase.testRunner; // Load the test config file let adapterName = 'pg'; -let allConfig = reload(configFile); -let config = allConfig[adapterName]; +const allConfig = testBase.config; +const config = allConfig[adapterName]; // Set up the query builder object let nodeQuery = reload('../../lib/NodeQuery')(config); diff --git a/test/base.js b/test/base.js index 49a9cce..4e29ca7 100644 --- a/test/base.js +++ b/test/base.js @@ -4,7 +4,11 @@ const chai = require('chai'); const chaiAsPromised = require('chai-as-promised'); chai.use(chaiAsPromised); +// Load the test config file +const configFile = './config.json'; + module.exports = { + config: require(configFile), expect: chai.expect, tests: require('./base/tests'), testRunner: require('./base/adapterCallbackTestRunner'), diff --git a/test/config-travis.json b/test/config-travis.json deleted file mode 100644 index 2cfdb25..0000000 --- a/test/config-travis.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "mysql": { - "driver": "mysql", - "connection": { - "host": "localhost", - "user": "root", - "password": "", - "database": "test" - } - }, - "pg": { - "driver": "pg", - "connection": "postgres://postgres@localhost/test" - }, - "pg-object": { - "driver": "pg", - "connection": { - "password": "", - "database": "test" - } - }, - "dblite": { - "driver": "sqlite", - "connection": ":memory:" - } -} \ No newline at end of file