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

Commit 70e92ce2 by Mick Hansen Committed by Jan Aagaard Meier

adds a sscce template where code can easily be copied and run inside docker (#5781)

1 parent e81f13e5
......@@ -12,3 +12,4 @@ test/sqlite/test.sqlite
coverage-*
site
docs/api/tmp.md
ssce.js
......@@ -129,7 +129,11 @@
"cover-all": "npm run cover-mysql && npm run cover-postgres && npm run cover-postgres-native && npm run cover-mssql && npm run cover-sqlite && npm run cover-mariadb && npm run merge-coverage",
"merge-coverage": "rm -rf coverage && mkdir coverage && ./node_modules/.bin/lcov-result-merger 'coverage-*/lcov.info' 'coverage/lcov.info'",
"codeclimate-send": "npm install -g codeclimate-test-reporter && CODECLIMATE_REPO_TOKEN=ce835a510bbf423a5ab5400a9bdcc2ec2d189d840b31657c6ee7cb9916b161d6 codeclimate-test-reporter < coverage/lcov.info",
"codeclimate": "npm run cover-all && npm run codeclimate-send"
"codeclimate": "npm run cover-all && npm run codeclimate-send",
"sscce": "docker-compose run sequelize /bin/sh -c \"node sscce.js\"",
"sscce-mysql": "DIALECT=mysql npm run sscce",
"sscce-postgres": "DIALECT=postgres npm run sscce",
"sscce-sqlite": "DIALECT=sqlite npm run sscce"
},
"engines": {
"node": ">=0.6.21"
......
/*
* Copy this file to ./sscce.js
* Add code from issue
* npm run sscce-{dialect}
*/
var Sequelize = require('./index');
var sequelize = require('./test/support').createSequelizeInstance();
......@@ -225,9 +225,11 @@ var Support = {
}
};
beforeEach(function() {
this.sequelize = Support.sequelize;
});
if (typeof beforeEach !== 'undefined') {
beforeEach(function() {
this.sequelize = Support.sequelize;
});
}
Support.sequelize = Support.createSequelizeInstance();
module.exports = Support;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!