不要怂,就是干,撸起袖子干!

Commit 9465875a by David Pate

Updated tests so that they are relying a little bit more on expect for checking …

…and also checking the actual type of error thrown.
1 parent 0ce299eb
Showing with 3 additions and 9 deletions
...@@ -18,24 +18,18 @@ describe(Support.getTestDialectTeaser("Configuration"), function() { ...@@ -18,24 +18,18 @@ describe(Support.getTestDialectTeaser("Configuration"), function() {
} }
var seq = new Sequelize(config[dialect].database, config[dialect].username, config[dialect].password, {storage: '/path/to/no/where/land', logging: false, host: '0.0.0.1', port: config[dialect].port, dialect: dialect}) var seq = new Sequelize(config[dialect].database, config[dialect].username, config[dialect].password, {storage: '/path/to/no/where/land', logging: false, host: '0.0.0.1', port: config[dialect].port, dialect: dialect})
seq.query('select 1 as hello').error(function(err) { return expect(seq.query('select 1 as hello')).to.eventually.be.rejectedWith(seq.InvalidConnectionError, 'connect EINVAL')
expect(err.message).to.match(/connect EINVAL/)
done()
})
}) })
it('when we don\'t have the correct login information', function(done) { it('when we don\'t have the correct login information', function(done) {
if (dialect !== "postgres" && dialect !== "postgres-native") { if (dialect !== "postgres" && dialect !== "postgres-native" && dialect !== "mysql") {
console.log('This dialect doesn\'t support me :(') console.log('This dialect doesn\'t support me :(')
expect(true).to.be.true // Silence Buster expect(true).to.be.true // Silence Buster
return done() return done()
} }
var seq = new Sequelize(config[dialect].database, config[dialect].username, 'fakepass123', {logging: false, host: config[dialect].host, port: 1, dialect: dialect}) var seq = new Sequelize(config[dialect].database, config[dialect].username, 'fakepass123', {logging: false, host: config[dialect].host, port: 1, dialect: dialect})
seq.query('select 1 as hello').error(function(err) { return expect(seq.query('select 1 as hello')).to.eventually.be.rejectedWith(seq.ConnectionRefusedError, 'connect ECONNREFUSED')
expect(err.message).to.match(/connect ECONNREFUSED/)
done()
})
}) })
it('when we don\'t have a valid dialect.', function(done) { it('when we don\'t have a valid dialect.', function(done) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!