-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revamping testing suit. #45
Open
dmill-bz
wants to merge
1
commit into
master
Choose a base branch
from
testing-revamp
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could clean this