@malloydata/malloy-tests 0.0.130-dev240311153734 → 0.0.130-dev240311192728
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/util/index.d.ts +1 -3
- package/dist/util/index.js +16 -26
- package/dist/util/index.js.map +1 -1
- package/package.json +7 -7
- package/src/util/index.ts +1 -37
- package/dist/model/utils.spec.d.ts +0 -1
- package/dist/model/utils.spec.js +0 -38
- package/dist/model/utils.spec.js.map +0 -1
- package/src/model/utils.spec.ts +0 -37
package/dist/util/index.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/// <reference types="jest" />
|
|
2
2
|
import { FilterExpression, QueryFieldDef, IndexFieldDef, Result, Runtime } from '@malloydata/malloy';
|
|
3
|
+
export * from '@malloydata/malloy/test';
|
|
3
4
|
export declare function fToQF(fs: (QueryFieldDef | string)[]): QueryFieldDef[];
|
|
4
5
|
export declare function fToIF(fs: string[]): IndexFieldDef[];
|
|
5
6
|
export declare function fStringEq(field: string, value: string): FilterExpression;
|
|
6
7
|
export declare function fStringLike(field: string, value: string): FilterExpression;
|
|
7
8
|
export declare function fYearEq(field: string, year: number): FilterExpression;
|
|
8
|
-
export declare function databasesFromEnvironmentOr(defaultDatabases: string[]): string[];
|
|
9
|
-
export declare function describeIfDatabaseAvailable(acceptableDatabases: string[]): [jest.Describe, string[]];
|
|
10
9
|
interface InitValues {
|
|
11
10
|
sql?: string;
|
|
12
11
|
malloy?: string;
|
|
@@ -14,4 +13,3 @@ interface InitValues {
|
|
|
14
13
|
export declare function mkSqlEqWith(runtime: Runtime, cName: string, initV?: InitValues): (expr: string, result: string | boolean | number) => Promise<Result>;
|
|
15
14
|
export declare function runQuery(runtime: Runtime, querySrc: string): Promise<Result>;
|
|
16
15
|
export declare function onlyIf(cond: boolean, condTest: jest.ProvidesCallback): jest.ProvidesCallback;
|
|
17
|
-
export {};
|
package/dist/util/index.js
CHANGED
|
@@ -21,8 +21,23 @@
|
|
|
21
21
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
22
22
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
23
23
|
*/
|
|
24
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
27
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
28
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
29
|
+
}
|
|
30
|
+
Object.defineProperty(o, k2, desc);
|
|
31
|
+
}) : (function(o, m, k, k2) {
|
|
32
|
+
if (k2 === undefined) k2 = k;
|
|
33
|
+
o[k2] = m[k];
|
|
34
|
+
}));
|
|
35
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
36
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
|
+
};
|
|
24
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.onlyIf = exports.runQuery = exports.mkSqlEqWith = exports.
|
|
39
|
+
exports.onlyIf = exports.runQuery = exports.mkSqlEqWith = exports.fYearEq = exports.fStringLike = exports.fStringEq = exports.fToIF = exports.fToQF = void 0;
|
|
40
|
+
__exportStar(require("@malloydata/malloy/test"), exports);
|
|
26
41
|
// these two helper functions are here just to make older hand built models
|
|
27
42
|
// easier to use in the new world were refs are not strings
|
|
28
43
|
function fToQF(fs) {
|
|
@@ -60,31 +75,6 @@ function fYearEq(field, year) {
|
|
|
60
75
|
};
|
|
61
76
|
}
|
|
62
77
|
exports.fYearEq = fYearEq;
|
|
63
|
-
// accepts databases in env, either via comma-separated dialect list (MALLOY_DATABASES=) or a single
|
|
64
|
-
// database (MALLOY_DATABASE=). returns either databases defined in env or a default list that was passed.
|
|
65
|
-
function databasesFromEnvironmentOr(defaultDatabases) {
|
|
66
|
-
return process.env['MALLOY_DATABASES']
|
|
67
|
-
? process.env['MALLOY_DATABASES'].split(',')
|
|
68
|
-
: process.env['MALLOY_DATABASE']
|
|
69
|
-
? [process.env['MALLOY_DATABASE']]
|
|
70
|
-
: defaultDatabases;
|
|
71
|
-
}
|
|
72
|
-
exports.databasesFromEnvironmentOr = databasesFromEnvironmentOr;
|
|
73
|
-
const describeSkip = Object.assign((name, fn) => describe.skip(name, fn), {
|
|
74
|
-
skip: describe.skip,
|
|
75
|
-
// eslint-disable-next-line no-restricted-properties
|
|
76
|
-
only: describe.only,
|
|
77
|
-
each: (() => () => it.skip('skipped', () => { })),
|
|
78
|
-
});
|
|
79
|
-
// confirms that one or more of the databases being tested overlaps with the databases a test suite can accept.
|
|
80
|
-
// if there is overlap, return a tuple of jest.describe and the dialects to be tested
|
|
81
|
-
// if there is no overlap, return a tuple if jest.describe.skip and the dialects to be tested
|
|
82
|
-
function describeIfDatabaseAvailable(acceptableDatabases) {
|
|
83
|
-
const currentDatabases = databasesFromEnvironmentOr(acceptableDatabases);
|
|
84
|
-
const overlap = acceptableDatabases.filter(d => currentDatabases.includes(d));
|
|
85
|
-
return overlap.length > 0 ? [describe, overlap] : [describeSkip, overlap];
|
|
86
|
-
}
|
|
87
|
-
exports.describeIfDatabaseAvailable = describeIfDatabaseAvailable;
|
|
88
78
|
function sqlSafe(str) {
|
|
89
79
|
return str
|
|
90
80
|
.replace(/'/g, '{single-quote}')
|
package/dist/util/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;;;;;;;;;;;;;;;AAWH,0DAAw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kCA0EC;AAEM,KAAK,UAAU,QAAQ,CAAC,OAAgB,EAAE,QAAgB;IAC/D,IAAI,KAAwB,CAAC;IAC7B,IAAI;QACF,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;KACrC;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;KACnD;IAED,IAAI,MAAc,CAAC;IACnB,IAAI;QACF,MAAM,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,CAAC;KAC5B;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,IAAI,KAAK,CACb,qBAAqB,CAAC,CAAC,OAAO,IAAI;YAChC,QAAQ,MAAM,KAAK,CAAC,MAAM,EAAE,IAAI;YAChC,CAAC,CAAC,KAAK,CACV,CAAC;KACH;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AApBD,4BAoBC;AAED,SAAgB,MAAM,CACpB,IAAa,EACb,QAA+B;IAE/B,IAAI,IAAI,EAAE;QACR,OAAO,QAAQ,CAAC;KACjB;SAAM;QACL,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;KACjB;AACH,CAAC;AATD,wBASC"}
|
package/package.json
CHANGED
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@jest/globals": "^29.4.3",
|
|
24
|
-
"@malloydata/db-bigquery": "^0.0.130-
|
|
25
|
-
"@malloydata/db-duckdb": "^0.0.130-
|
|
26
|
-
"@malloydata/db-postgres": "^0.0.130-
|
|
27
|
-
"@malloydata/db-snowflake": "^0.0.130-
|
|
28
|
-
"@malloydata/malloy": "^0.0.130-
|
|
29
|
-
"@malloydata/render": "^0.0.130-
|
|
24
|
+
"@malloydata/db-bigquery": "^0.0.130-dev240311192728",
|
|
25
|
+
"@malloydata/db-duckdb": "^0.0.130-dev240311192728",
|
|
26
|
+
"@malloydata/db-postgres": "^0.0.130-dev240311192728",
|
|
27
|
+
"@malloydata/db-snowflake": "^0.0.130-dev240311192728",
|
|
28
|
+
"@malloydata/malloy": "^0.0.130-dev240311192728",
|
|
29
|
+
"@malloydata/render": "^0.0.130-dev240311192728",
|
|
30
30
|
"jsdom": "^22.1.0",
|
|
31
31
|
"luxon": "^2.4.0",
|
|
32
32
|
"madge": "^6.0.0"
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"@types/jsdom": "^21.1.1",
|
|
36
36
|
"@types/luxon": "^2.4.0"
|
|
37
37
|
},
|
|
38
|
-
"version": "0.0.130-
|
|
38
|
+
"version": "0.0.130-dev240311192728"
|
|
39
39
|
}
|
package/src/util/index.ts
CHANGED
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
Result,
|
|
31
31
|
Runtime,
|
|
32
32
|
} from '@malloydata/malloy';
|
|
33
|
+
export * from '@malloydata/malloy/test';
|
|
33
34
|
|
|
34
35
|
// these two helper functions are here just to make older hand built models
|
|
35
36
|
// easier to use in the new world were refs are not strings
|
|
@@ -72,43 +73,6 @@ export function fYearEq(field: string, year: number): FilterExpression {
|
|
|
72
73
|
};
|
|
73
74
|
}
|
|
74
75
|
|
|
75
|
-
// accepts databases in env, either via comma-separated dialect list (MALLOY_DATABASES=) or a single
|
|
76
|
-
// database (MALLOY_DATABASE=). returns either databases defined in env or a default list that was passed.
|
|
77
|
-
export function databasesFromEnvironmentOr(
|
|
78
|
-
defaultDatabases: string[]
|
|
79
|
-
): string[] {
|
|
80
|
-
return process.env['MALLOY_DATABASES']
|
|
81
|
-
? process.env['MALLOY_DATABASES'].split(',')
|
|
82
|
-
: process.env['MALLOY_DATABASE']
|
|
83
|
-
? [process.env['MALLOY_DATABASE']]
|
|
84
|
-
: defaultDatabases;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const describeSkip: jest.Describe = Object.assign(
|
|
88
|
-
(
|
|
89
|
-
name: number | string | Function | jest.FunctionLike,
|
|
90
|
-
fn: jest.EmptyFunction
|
|
91
|
-
) => describe.skip(name, fn),
|
|
92
|
-
{
|
|
93
|
-
skip: describe.skip,
|
|
94
|
-
// eslint-disable-next-line no-restricted-properties
|
|
95
|
-
only: describe.only,
|
|
96
|
-
each: (() => () => it.skip('skipped', () => {})) as unknown as jest.Each,
|
|
97
|
-
}
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
// confirms that one or more of the databases being tested overlaps with the databases a test suite can accept.
|
|
101
|
-
// if there is overlap, return a tuple of jest.describe and the dialects to be tested
|
|
102
|
-
// if there is no overlap, return a tuple if jest.describe.skip and the dialects to be tested
|
|
103
|
-
export function describeIfDatabaseAvailable(
|
|
104
|
-
acceptableDatabases: string[]
|
|
105
|
-
): [jest.Describe, string[]] {
|
|
106
|
-
const currentDatabases = databasesFromEnvironmentOr(acceptableDatabases);
|
|
107
|
-
const overlap = acceptableDatabases.filter(d => currentDatabases.includes(d));
|
|
108
|
-
|
|
109
|
-
return overlap.length > 0 ? [describe, overlap] : [describeSkip, overlap];
|
|
110
|
-
}
|
|
111
|
-
|
|
112
76
|
interface InitValues {
|
|
113
77
|
sql?: string;
|
|
114
78
|
malloy?: string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/model/utils.spec.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright 2023 Google LLC
|
|
4
|
-
*
|
|
5
|
-
* Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
-
* a copy of this software and associated documentation files
|
|
7
|
-
* (the "Software"), to deal in the Software without restriction,
|
|
8
|
-
* including without limitation the rights to use, copy, modify, merge,
|
|
9
|
-
* publish, distribute, sublicense, and/or sell copies of the Software,
|
|
10
|
-
* and to permit persons to whom the Software is furnished to do so,
|
|
11
|
-
* subject to the following conditions:
|
|
12
|
-
*
|
|
13
|
-
* The above copyright notice and this permission notice shall be
|
|
14
|
-
* included in all copies or substantial portions of the Software.
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
-
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
-
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
-
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
20
|
-
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
-
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
22
|
-
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
-
*/
|
|
24
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
// eslint-disable-next-line no-restricted-imports
|
|
26
|
-
const utils_1 = require("@malloydata/malloy/src/model/utils");
|
|
27
|
-
describe('model/utils', () => {
|
|
28
|
-
it('should generate deterministic hashes', () => {
|
|
29
|
-
const hash1 = (0, utils_1.generateHash)('test-content');
|
|
30
|
-
expect(hash1).toEqual('ab17568f-0362-503d-a9c6-76fb0b203636');
|
|
31
|
-
});
|
|
32
|
-
it('should generate unique hashes', () => {
|
|
33
|
-
const hash1 = (0, utils_1.generateHash)('test-content');
|
|
34
|
-
const hash2 = (0, utils_1.generateHash)('test-content-different');
|
|
35
|
-
expect(hash1).not.toEqual(hash2);
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
//# sourceMappingURL=utils.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.spec.js","sourceRoot":"","sources":["../../src/model/utils.spec.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;AAEH,iDAAiD;AACjD,8DAAgE;AAEhE,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC9C,MAAM,KAAK,GAAG,IAAA,oBAAY,EAAC,cAAc,CAAC,CAAC;QAC3C,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,sCAAsC,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE;QACvC,MAAM,KAAK,GAAG,IAAA,oBAAY,EAAC,cAAc,CAAC,CAAC;QAC3C,MAAM,KAAK,GAAG,IAAA,oBAAY,EAAC,wBAAwB,CAAC,CAAC;QACrD,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/src/model/utils.spec.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2023 Google LLC
|
|
3
|
-
*
|
|
4
|
-
* Permission is hereby granted, free of charge, to any person obtaining
|
|
5
|
-
* a copy of this software and associated documentation files
|
|
6
|
-
* (the "Software"), to deal in the Software without restriction,
|
|
7
|
-
* including without limitation the rights to use, copy, modify, merge,
|
|
8
|
-
* publish, distribute, sublicense, and/or sell copies of the Software,
|
|
9
|
-
* and to permit persons to whom the Software is furnished to do so,
|
|
10
|
-
* subject to the following conditions:
|
|
11
|
-
*
|
|
12
|
-
* The above copyright notice and this permission notice shall be
|
|
13
|
-
* included in all copies or substantial portions of the Software.
|
|
14
|
-
*
|
|
15
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
16
|
-
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
17
|
-
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
18
|
-
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
19
|
-
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
20
|
-
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
21
|
-
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
// eslint-disable-next-line no-restricted-imports
|
|
25
|
-
import {generateHash} from '@malloydata/malloy/src/model/utils';
|
|
26
|
-
|
|
27
|
-
describe('model/utils', () => {
|
|
28
|
-
it('should generate deterministic hashes', () => {
|
|
29
|
-
const hash1 = generateHash('test-content');
|
|
30
|
-
expect(hash1).toEqual('ab17568f-0362-503d-a9c6-76fb0b203636');
|
|
31
|
-
});
|
|
32
|
-
it('should generate unique hashes', () => {
|
|
33
|
-
const hash1 = generateHash('test-content');
|
|
34
|
-
const hash2 = generateHash('test-content-different');
|
|
35
|
-
expect(hash1).not.toEqual(hash2);
|
|
36
|
-
});
|
|
37
|
-
});
|