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

Commit 4a96976f by Mick Hansen

fix(test): bad callbacks in hooks test

1 parent c26c5f4d
Showing with 13 additions and 13 deletions
...@@ -17,15 +17,15 @@ else ...@@ -17,15 +17,15 @@ else
test: test:
make jshint && make teaser && make test-unit && make test-integration make jshint && make teaser && make test-unit && make test-integration
@if [ "$$GREP" ]; then \ @if [ "$$GREP" ]; then \
make jshint && make teaser && ./node_modules/mocha/bin/mocha --globals setImmediate,clearImmediate --ui tdd --check-leaks --colors -t 10000 --reporter $(REPORTER) -g "$$GREP" $(TESTS); \ make jshint && make teaser && ./node_modules/mocha/bin/mocha --globals setImmediate,clearImmediate --ui tdd --check-leaks --colors -t 15000 --reporter $(REPORTER) -g "$$GREP" $(TESTS); \
else \ else \
make jshint && make teaser && ./node_modules/mocha/bin/mocha --globals setImmediate,clearImmediate --ui tdd --check-leaks --colors -t 10000 --reporter $(REPORTER) $(TESTS); \ make jshint && make teaser && ./node_modules/mocha/bin/mocha --globals setImmediate,clearImmediate --ui tdd --check-leaks --colors -t 15000 --reporter $(REPORTER) $(TESTS); \
fi fi
endif endif
# Unit tests # Unit tests
test-unit: test-unit:
./node_modules/mocha/bin/mocha --globals setImmediate,clearImmediate --ui tdd --check-leaks --colors -t 10000 --reporter $(REPORTER) ./test/unit/*.js ./test/unit/**/*.js ./node_modules/mocha/bin/mocha --globals setImmediate,clearImmediate --ui tdd --check-leaks --colors -t 15000 --reporter $(REPORTER) ./test/unit/*.js ./test/unit/**/*.js
test-unit-all: test-unit-sqlite test-unit-mysql test-unit-postgres test-unit-postgres-native test-unit-mariadb test-unit-mssql test-unit-all: test-unit-sqlite test-unit-mysql test-unit-postgres test-unit-postgres-native test-unit-mariadb test-unit-mssql
...@@ -45,9 +45,9 @@ test-unit-postgres-native: ...@@ -45,9 +45,9 @@ test-unit-postgres-native:
# Integration tests # Integration tests
test-integration: test-integration:
@if [ "$$GREP" ]; then \ @if [ "$$GREP" ]; then \
./node_modules/mocha/bin/mocha --globals setImmediate,clearImmediate --ui tdd --check-leaks --colors -t 10000 --reporter $(REPORTER) -g "$$GREP" $(TESTS); \ ./node_modules/mocha/bin/mocha --globals setImmediate,clearImmediate --ui tdd --check-leaks --colors -t 15000 --reporter $(REPORTER) -g "$$GREP" $(TESTS); \
else \ else \
./node_modules/mocha/bin/mocha --globals setImmediate,clearImmediate --ui tdd --check-leaks --colors -t 10000 --reporter $(REPORTER) $(TESTS); \ ./node_modules/mocha/bin/mocha --globals setImmediate,clearImmediate --ui tdd --check-leaks --colors -t 15000 --reporter $(REPORTER) $(TESTS); \
fi fi
test-integration-all: test-integration-sqlite test-integration-mysql test-integration-postgres test-integration-postgres-native test-integration-mariadb test-integration-mssql test-integration-all: test-integration-sqlite test-integration-mysql test-integration-postgres test-integration-postgres-native test-integration-mariadb test-integration-mssql
...@@ -85,7 +85,7 @@ postgres-native: ...@@ -85,7 +85,7 @@ postgres-native:
# Coverage # Coverage
cover: cover:
rm -rf coverage \ rm -rf coverage \
make teaser && ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- -t 10000 --ui tdd $(TESTS); \ make teaser && ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- -t 15000 --ui tdd $(TESTS); \
mariadb-cover: mariadb-cover:
rm -rf coverage rm -rf coverage
......
...@@ -5558,9 +5558,9 @@ describe(Support.getTestDialectTeaser('Hooks'), function() { ...@@ -5558,9 +5558,9 @@ describe(Support.getTestDialectTeaser('Hooks'), function() {
this.MiniTasks.create({mini_title: 'New MiniTask'}) this.MiniTasks.create({mini_title: 'New MiniTask'})
]).bind(this).spread(function(project, task, minitask) { ]).bind(this).spread(function(project, task, minitask) {
return this.sequelize.Promise.all([ return this.sequelize.Promise.all([
task.addMiniTask(minitask), task.addMiniTask(minitask),
project.addTask(task) project.addTask(task)
]).return(project); ]).return(project);
}).then(function(project) { }).then(function(project) {
return project.destroy(); return project.destroy();
}).then(function() { }).then(function() {
...@@ -5596,7 +5596,6 @@ describe(Support.getTestDialectTeaser('Hooks'), function() { ...@@ -5596,7 +5596,6 @@ describe(Support.getTestDialectTeaser('Hooks'), function() {
this.Tasks.beforeDestroy(function(task, options, fn) { this.Tasks.beforeDestroy(function(task, options, fn) {
beforeTask = true; beforeTask = true;
fn(new Error('Whoops!')); fn(new Error('Whoops!'));
fn();
}); });
this.Tasks.afterDestroy(function(task, options, fn) { this.Tasks.afterDestroy(function(task, options, fn) {
...@@ -5606,6 +5605,7 @@ describe(Support.getTestDialectTeaser('Hooks'), function() { ...@@ -5606,6 +5605,7 @@ describe(Support.getTestDialectTeaser('Hooks'), function() {
this.MiniTasks.beforeDestroy(function(minitask, options, fn) { this.MiniTasks.beforeDestroy(function(minitask, options, fn) {
beforeMiniTask = true; beforeMiniTask = true;
fn();
}); });
this.MiniTasks.afterDestroy(function(minitask, options, fn) { this.MiniTasks.afterDestroy(function(minitask, options, fn) {
...@@ -5619,9 +5619,9 @@ describe(Support.getTestDialectTeaser('Hooks'), function() { ...@@ -5619,9 +5619,9 @@ describe(Support.getTestDialectTeaser('Hooks'), function() {
this.MiniTasks.create({mini_title: 'New MiniTask'}) this.MiniTasks.create({mini_title: 'New MiniTask'})
]).bind(this).spread(function(project, task, minitask) { ]).bind(this).spread(function(project, task, minitask) {
return this.sequelize.Promise.all([ return this.sequelize.Promise.all([
task.addMiniTask(minitask), task.addMiniTask(minitask),
project.addTask(task) project.addTask(task)
]).return(project); ]).return(project);
}).then(function(project) { }).then(function(project) {
return project.destroy(); return project.destroy();
}).catch(function() { }).catch(function() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!