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

Commit 40e0769e by Jan Aagaard Meier

Tell istanbul to ignore abstract method in abstract query generator. https://git…

…hub.com/gotwarlost/istanbul/blob/master/ignoring-code-for-coverage.md
1 parent e56eabef
Showing with 23 additions and 1 deletions
......@@ -38,6 +38,7 @@ module.exports = (function() {
- options: An object with options.
Defaults: { engine: 'InnoDB', charset: null }
*/
/* istanbul ignore next */
createTableQuery: function(tableName, attributes, options) {
throwMethodUndefined('createTableQuery');
},
......@@ -86,6 +87,7 @@ module.exports = (function() {
/*
Returns a query, which gets all available table names in the database.
*/
/* istanbul ignore next */
showTablesQuery: function() {
throwMethodUndefined('showTablesQuery');
},
......@@ -101,6 +103,7 @@ module.exports = (function() {
- defaultValue: A String with the default value
- allowNull: Boolean
*/
/* istanbul ignore next */
addColumnQuery: function(tableName, attributes) {
throwMethodUndefined('addColumnQuery');
},
......@@ -111,6 +114,7 @@ module.exports = (function() {
- tableName: Name of the existing table
- attributeName: Name of the obsolete attribute.
*/
/* istanbul ignore next */
removeColumnQuery: function(tableName, attributeName) {
throwMethodUndefined('removeColumnQuery');
},
......@@ -126,6 +130,7 @@ module.exports = (function() {
- defaultValue: A String with the default value
- allowNull: Boolean
*/
/* istanbul ignore next */
changeColumnQuery: function(tableName, attributes) {
throwMethodUndefined('changeColumnQuery');
},
......@@ -137,6 +142,7 @@ module.exports = (function() {
- attrNameBefore: The name of the attribute, which shall be renamed.
- attrNameAfter: The name of the attribute, after renaming.
*/
/* istanbul ignore next */
renameColumnQuery: function(tableName, attrNameBefore, attrNameAfter) {
throwMethodUndefined('renameColumnQuery');
},
......@@ -210,6 +216,7 @@ module.exports = (function() {
Returns an insert into command for multiple values.
Parameters: table name + list of hashes of attribute-value-pairs.
*/
/* istanbul ignore next */
bulkInsertQuery: function(tableName, attrValueHashes) {
throwMethodUndefined('bulkInsertQuery');
},
......@@ -272,6 +279,7 @@ module.exports = (function() {
(@see http://dev.mysql.com/doc/refman/5.6/en/truncate-table.html).
Note that truncate must ignore limit and where
*/
/* istanbul ignore next */
deleteQuery: function(tableName, where, options) {
throwMethodUndefined('deleteQuery');
},
......@@ -408,6 +416,7 @@ module.exports = (function() {
- options:
- database: Name of the database.
*/
/* istanbul ignore next */
showIndexQuery: function(tableName, options) {
throwMethodUndefined('showIndexQuery');
},
......@@ -418,6 +427,7 @@ module.exports = (function() {
- tableName: Name of an existing table.
- indexNameOrAttributes: The name of the index as string or an array of attribute names.
*/
/* istanbul ignore next */
removeIndexQuery: function(tableName, indexNameOrAttributes) {
throwMethodUndefined('removeIndexQuery');
},
......@@ -426,6 +436,7 @@ module.exports = (function() {
This method transforms an array of attribute hashes into equivalent
sql attribute definition.
*/
/* istanbul ignore next */
attributesToSQL: function(attributes) {
throwMethodUndefined('attributesToSQL');
},
......@@ -433,6 +444,7 @@ module.exports = (function() {
/*
Returns all auto increment fields of a factory.
*/
/* istanbul ignore next */
findAutoIncrementField: function(factory) {
throwMethodUndefined('findAutoIncrementField');
},
......@@ -555,6 +567,7 @@ module.exports = (function() {
/*
Create a trigger
*/
/* istanbul ignore next */
createTrigger: function(tableName, triggerName, timingType, fireOnArray, functionName, functionParams,
optionsArray) {
throwMethodUndefined('createTrigger');
......@@ -563,13 +576,15 @@ module.exports = (function() {
/*
Drop a trigger
*/
/* istanbul ignore next */
dropTrigger: function(tableName, triggerName) {
throwMethodUndefined('dropTrigger');
},
/*
Rename a trigger
*/
*/
/* istanbul ignore next */
renameTrigger: function(tableName, oldTriggerName, newTriggerName) {
throwMethodUndefined('renameTrigger');
},
......@@ -577,6 +592,7 @@ module.exports = (function() {
/*
Create a function
*/
/* istanbul ignore next */
createFunction: function(functionName, params, returnType, language, body, options) {
throwMethodUndefined('createFunction');
},
......@@ -584,6 +600,7 @@ module.exports = (function() {
/*
Drop a function
*/
/* istanbul ignore next */
dropFunction: function(functionName, params) {
throwMethodUndefined('dropFunction');
},
......@@ -591,6 +608,7 @@ module.exports = (function() {
/*
Rename a function
*/
/* istanbul ignore next */
renameFunction: function(oldFunctionName, params, newFunctionName) {
throwMethodUndefined('renameFunction');
},
......@@ -598,6 +616,7 @@ module.exports = (function() {
/*
Escape an identifier (e.g. a table or attribute name)
*/
/* istanbul ignore next */
quoteIdentifier: function(identifier, force) {
throwMethodUndefined('quoteIdentifier');
},
......@@ -632,6 +651,7 @@ module.exports = (function() {
* @param {String} schemaName The name of the schema.
* @return {String} The generated sql query.
*/
/* istanbul ignore next */
getForeignKeysQuery: function(tableName, schemaName) {
throwMethodUndefined('getForeignKeysQuery');
},
......@@ -643,6 +663,7 @@ module.exports = (function() {
* @param {String} foreignKey The name of the foreign key constraint.
* @return {String} The generated sql query.
*/
/* istanbul ignore next */
dropForeignKeyQuery: function(tableName, foreignKey) {
throwMethodUndefined('dropForeignKeyQuery');
},
......@@ -1473,6 +1494,7 @@ module.exports = (function() {
}
};
/* istanbul ignore next */
var throwMethodUndefined = function(methodName) {
throw new Error('The method "' + methodName + '" is not defined! Please add it to your sql dialect.');
};
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!