mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-09-11 10:46:25 +03:00
fix console test environment (#3192)
This commit is contained in:
parent
6d92e4f9db
commit
8000652a5d
@ -44,6 +44,7 @@ export API_PORT=9693
|
||||
export CONSOLE_MODE=cli
|
||||
export DEV_DATA_API_URL=http://localhost:8080
|
||||
export URL_PREFIX=/
|
||||
export SERVER_VERSION=$(cat /build/_server_output/version.txt)
|
||||
|
||||
# test console
|
||||
npm run dev &
|
||||
|
@ -19,20 +19,20 @@ const featureLaunchVersions = {
|
||||
[COMPUTED_COLUMNS_SUPPORT]: 'v1.0.0-beta.8',
|
||||
};
|
||||
|
||||
export const checkValidServerVersion = version => {
|
||||
return semver.valid(version) !== null;
|
||||
};
|
||||
|
||||
export const getFeaturesCompatibility = serverVersion => {
|
||||
const featuresCompatibility = {};
|
||||
|
||||
const isPullRequest = serverVersion.startsWith('pull');
|
||||
const isValidServerVersion = checkValidServerVersion(serverVersion);
|
||||
|
||||
try {
|
||||
Object.keys(featureLaunchVersions).forEach(feature => {
|
||||
featuresCompatibility[feature] =
|
||||
isPullRequest ||
|
||||
semver.satisfies(featureLaunchVersions[feature], '<=' + serverVersion);
|
||||
});
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
Object.keys(featureLaunchVersions).forEach(feature => {
|
||||
featuresCompatibility[feature] = isValidServerVersion
|
||||
? semver.satisfies(featureLaunchVersions[feature], '<=' + serverVersion)
|
||||
: true;
|
||||
});
|
||||
|
||||
return featuresCompatibility;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user