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

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
test:
make jshint && make teaser && make test-unit && make test-integration
@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 \
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
endif
# Unit tests
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
......@@ -45,9 +45,9 @@ test-unit-postgres-native:
# Integration tests
test-integration:
@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 \
./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
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:
# Coverage
cover:
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:
rm -rf coverage
......
......@@ -5558,9 +5558,9 @@ describe(Support.getTestDialectTeaser('Hooks'), function() {
this.MiniTasks.create({mini_title: 'New MiniTask'})
]).bind(this).spread(function(project, task, minitask) {
return this.sequelize.Promise.all([
task.addMiniTask(minitask),
project.addTask(task)
]).return(project);
task.addMiniTask(minitask),
project.addTask(task)
]).return(project);
}).then(function(project) {
return project.destroy();
}).then(function() {
......@@ -5596,7 +5596,6 @@ describe(Support.getTestDialectTeaser('Hooks'), function() {
this.Tasks.beforeDestroy(function(task, options, fn) {
beforeTask = true;
fn(new Error('Whoops!'));
fn();
});
this.Tasks.afterDestroy(function(task, options, fn) {
......@@ -5606,6 +5605,7 @@ describe(Support.getTestDialectTeaser('Hooks'), function() {
this.MiniTasks.beforeDestroy(function(minitask, options, fn) {
beforeMiniTask = true;
fn();
});
this.MiniTasks.afterDestroy(function(minitask, options, fn) {
......@@ -5619,9 +5619,9 @@ describe(Support.getTestDialectTeaser('Hooks'), function() {
this.MiniTasks.create({mini_title: 'New MiniTask'})
]).bind(this).spread(function(project, task, minitask) {
return this.sequelize.Promise.all([
task.addMiniTask(minitask),
project.addTask(task)
]).return(project);
task.addMiniTask(minitask),
project.addTask(task)
]).return(project);
}).then(function(project) {
return project.destroy();
}).catch(function() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!