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

Commit 566bbcf5 by Daniel Durante

Merge branch 'master' into milestones/2.0.0

2 parents 9f4fca12 1133077c
...@@ -139,30 +139,27 @@ $ npm install ...@@ -139,30 +139,27 @@ $ npm install
### 4. Run the tests ### ### 4. Run the tests ###
Right now, the test base is split into the `spec` folder (which contains the Right now, the test base is split into the `test` folder (which contains the
lovely [BusterJS](http://busterjs.org) tests). lovely [Mocha](http://visionmedia.github.io/mocha/) tests).
As you might haven't installed all of the supported SQL dialects, here is how As you might haven't installed all of the supported SQL dialects, here is how
to run the test suites for your development environment: to run the test suites for your development environment:
```console ```console
$ # run all tests at once: $ # run all tests at once:
$ npm test $ make all
$ # run all of the buster specs (for all dialects):
$ npm run test-buster
$ # run the buster specs for mysql: $ # run the buster specs for mysql:
$ npm run test-buster-mysql $ make mysql
$ # run the buster specs for sqlite: $ # run the buster specs for sqlite:
$ npm run test-buster-sqlite $ make sqlite
$ # run the buster specs for postgresql: $ # run the buster specs for postgresql:
$ npm run test-buster-postgres $ make pgsql
$ # alternatively you can pass database credentials with $variables when testing with buster.js $ # alternatively you can pass database credentials with $variables when testing
$ DIALECT=dialect SEQ_DB=database SEQ_USER=user SEQ_PW=password buster-test $ DIALECT=dialect SEQ_DB=database SEQ_USER=user SEQ_PW=password make test
``` ```
### 5. That's all ### ### 5. That's all ###
......
...@@ -9,11 +9,6 @@ chai.Assertion.includeStack = true ...@@ -9,11 +9,6 @@ chai.Assertion.includeStack = true
if (dialect.match(/^postgres/)) { if (dialect.match(/^postgres/)) {
describe('[POSTGRES Specific] associations', function() { describe('[POSTGRES Specific] associations', function() {
beforeEach(function(done) {
this.sequelize.options.quoteIdentifier = true
done()
})
describe('many-to-many', function() { describe('many-to-many', function() {
describe('where tables have the same prefix', function() { describe('where tables have the same prefix', function() {
it("should create a table wp_table1wp_table2s", function(done) { it("should create a table wp_table1wp_table2s", function(done) {
...@@ -76,7 +71,6 @@ if (dialect.match(/^postgres/)) { ...@@ -76,7 +71,6 @@ if (dialect.match(/^postgres/)) {
tasks[tasks.length] = {name: 'Task' + Math.random()} tasks[tasks.length] = {name: 'Task' + Math.random()}
} }
self.sequelize.getQueryInterface().dropAllTables().success(function() {
self.User.sync({ force: true }).success(function() { self.User.sync({ force: true }).success(function() {
self.Task.sync({ force: true }).success(function() { self.Task.sync({ force: true }).success(function() {
self.User.bulkCreate(users).success(function() { self.User.bulkCreate(users).success(function() {
...@@ -93,7 +87,6 @@ if (dialect.match(/^postgres/)) { ...@@ -93,7 +87,6 @@ if (dialect.match(/^postgres/)) {
}) })
}) })
}) })
})
it('should correctly add an association to the dao', function(done) { it('should correctly add an association to the dao', function(done) {
var self = this var self = this
......
...@@ -48,7 +48,7 @@ describe(Support.getTestDialectTeaser("QueryInterface"), function () { ...@@ -48,7 +48,7 @@ describe(Support.getTestDialectTeaser("QueryInterface"), function () {
}) })
describe('indexes', function() { describe('indexes', function() {
before(function(done) { beforeEach(function(done) {
var self = this var self = this
this.queryInterface.dropTable('Users').success(function() { this.queryInterface.dropTable('Users').success(function() {
self.queryInterface.createTable('Users', { self.queryInterface.createTable('Users', {
......
...@@ -121,7 +121,7 @@ before(function(done) { ...@@ -121,7 +121,7 @@ before(function(done) {
done() done()
}) })
afterEach(function(done) { beforeEach(function(done) {
Support.clearDatabase(this.sequelize, function() { Support.clearDatabase(this.sequelize, function() {
done() done()
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!