JSHint is not ready for modern javascript

This commit is contained in:
Daniel García Aubert
2019-10-15 11:46:44 +02:00
parent c4054f0ac9
commit f8e117a7b7
2 changed files with 20 additions and 17 deletions
+2 -2
View File
@@ -368,8 +368,8 @@ describe('tests from old api translated to multilayer', function() {
keysToDelete['user:localhost:mapviews:global'] = 5;
var affectedFn = QueryTables.getQueryMetadataModel;
QueryTables.getQueryMetadataModel = async function (pg, sql) {
throw new Error('fake error message');
QueryTables.getQueryMetadataModel = function () {
return Promise.reject(new Error('fake error message'));
};
// reset internal cacheChannel cache
+18 -15
View File
@@ -32,27 +32,30 @@ describe('QueryTables', function() {
// Check test/support/sql/windshaft.test.sql to understand where the values come from.
it('should return an object with affected tables array and last updated time', async function () {
it('should return an object with affected tables array and last updated time', function () {
var query = 'select * from test_table';
const result = await QueryTables.getQueryMetadataModel(connection, query);
return QueryTables.getQueryMetadataModel(connection, query)
.then(result => {
assert.equal(result.getLastUpdatedAt(), 1234567890123);
assert.equal(result.getLastUpdatedAt(), 1234567890123);
assert.equal(result.tables.length, 1);
assert.equal(result.tables[0].dbname, 'test_windshaft_cartodb_user_1_db');
assert.equal(result.tables[0].schema_name, 'public');
assert.equal(result.tables[0].table_name, 'test_table');
});
assert.equal(result.tables.length, 1);
assert.equal(result.tables[0].dbname, 'test_windshaft_cartodb_user_1_db');
assert.equal(result.tables[0].schema_name, 'public');
assert.equal(result.tables[0].table_name, 'test_table');
});
it('should work with private tables', async function () {
it('should work with private tables', function () {
var query = 'select * from test_table_private_1';
const result = await QueryTables.getQueryMetadataModel(connection, query);
return QueryTables.getQueryMetadataModel(connection, query)
.then(result => {
assert.equal(result.getLastUpdatedAt(), 1234567890123);
assert.equal(result.getLastUpdatedAt(), 1234567890123);
assert.equal(result.tables.length, 1);
assert.equal(result.tables[0].dbname, 'test_windshaft_cartodb_user_1_db');
assert.equal(result.tables[0].schema_name, 'public');
assert.equal(result.tables[0].table_name, 'test_table_private_1');
assert.equal(result.tables.length, 1);
assert.equal(result.tables[0].dbname, 'test_windshaft_cartodb_user_1_db');
assert.equal(result.tables[0].schema_name, 'public');
assert.equal(result.tables[0].table_name, 'test_table_private_1');
});
});
});