-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial commit for browser and coverage support
- Loading branch information
Showing
17 changed files
with
141 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
var path = require('path'); | ||
module.exports = function (config) { | ||
config.set({ | ||
|
||
basePath: '.', | ||
|
||
frameworks: ['mocha', 'chai', 'sinon'], | ||
singleRun: true, //just run once by default | ||
|
||
files: [ | ||
'tests.webpack.js', //just load this file instead of individual test files. It will fetch the proper content | ||
], | ||
preprocessors: { | ||
'tests.webpack.js': [ 'webpack', 'sourcemap'] //preprocess with webpack and our sourcemap loader | ||
}, | ||
|
||
//~ babelPreprocessor: { | ||
//~ "plugins": [ | ||
//~ "transform-runtime", | ||
//~ ["transform-async-to-module-method", { | ||
//~ "module": "bluebird", | ||
//~ "method": "coroutine" | ||
//~ }] | ||
//~ ] | ||
//~ }, | ||
|
||
webpack: { //kind of a copy of your webpack config | ||
debug:true, | ||
devtool: 'inline-source-map', //just do inline source maps instead of the default | ||
output: { | ||
library: 'gremlin', | ||
libraryTarget: 'umd' | ||
}, | ||
module: { | ||
preLoaders: [ | ||
// instrument only testing sources with Istanbul | ||
{ | ||
test: /\.js$/, | ||
include: path.resolve('src/'), | ||
loader: 'isparta' | ||
} | ||
], | ||
loaders: [ | ||
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel' } | ||
] | ||
} | ||
}, | ||
|
||
reporters: ['mocha', 'coverage', 'coveralls'], | ||
|
||
coverageReporter: { | ||
type: 'lcov', // lcov or lcovonly are required for generating lcov.info files | ||
dir: 'coverage/' | ||
}, | ||
|
||
port: 9876, | ||
colors: true, | ||
autoWatch: false, | ||
singleRun: false, | ||
|
||
// level of logging | ||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG | ||
logLevel: config.LOG_INFO, | ||
|
||
browsers: ['Firefox'], | ||
plugins: [ | ||
'karma-firefox-launcher', | ||
'karma-mocha', | ||
'karma-chai', | ||
'karma-webpack', | ||
'karma-sourcemap-loader', | ||
'karma-mocha-reporter', | ||
'karma-coverage', | ||
'karma-coveralls', | ||
'karma-sinon' | ||
] | ||
|
||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import Client from '../src/GremlinClient'; | ||
|
||
describe('GremlinClient', () => { | ||
describe('.construct()', () => { | ||
|
||
it('should allow setting the `port` option', () => { | ||
const client = new Client(8183); | ||
client.on('error', (err) => {}); //catch error | ||
client.port.should.equal(8183); | ||
}); | ||
|
||
it('should allow setting the `host` option', () => { | ||
const client = new Client(8182, "otherhost"); | ||
client.on('error', (err) => {}); //catch error | ||
client.host.should.equal('otherhost'); | ||
}); | ||
|
||
it('should allow setting session option', () => { | ||
const client = new Client(8182, "localhost", {session:true}); | ||
client.port.should.equal(8182); | ||
client.host.should.equal('localhost'); | ||
client.options.session.should.equal(true); | ||
}); | ||
}); | ||
}); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
//tell karma which files to load. | ||
var testContext = require.context('./test', true, /Test\.js$/); | ||
testContext.keys().forEach(testContext); | ||
|
||
var allContext = require.context('./src', true, /\.js$/); | ||
allContext.keys().forEach(allContext); |