Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/cubejs-schema-compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"coveragePathIgnorePatterns": [
".*\\.d\\.ts"
],
"globalSetup": "<rootDir>/dist/test/global-setup.js"
"globalSetup": "<rootDir>/dist/test/global-setup.js",
"snapshotResolver": "<rootDir>/test/snapshotResolver.js"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export class CubeToMetaTransformer {
? this.isVisible(nameToDimension[1], !nameToDimension[1].primaryKey)
: false,
primaryKey: !!nameToDimension[1].primaryKey,
aliasMember: nameToDimension[1].aliasMember,
granularities:
nameToDimension[1].granularities
? R.compose(R.map((g) => ({
Expand Down
26 changes: 26 additions & 0 deletions packages/cubejs-schema-compiler/test/snapshotResolver.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const path = require('path');

function resolveSnapshotPath(testPath, snapshotExtension) {
const testSourcePath = testPath.replace('dist/', '');
const testDirectory = path.dirname(testSourcePath);
const testFilename = path.basename(testSourcePath).replace('.js', '.ts');

return `${testDirectory}/__snapshots__/${testFilename}${snapshotExtension}`;
}

function resolveTestPath(snapshotFilePath, snapshotExtension) {
const testSourceFile = snapshotFilePath
.replace('test/unit/__snapshots__', 'dist/test/unit')
.replace('test/integration/__snapshots__', 'dist/test/integration')
.replace('.ts', '.js')
.replace(snapshotExtension, '');

return testSourceFile;
}

module.exports = {
resolveSnapshotPath,
resolveTestPath,

testPathForConsistencyCheck: 'dist/test/unit/Test.spec.js'
};
Loading
Loading