Skip to content

Commit

Permalink
rename only if exists
Browse files Browse the repository at this point in the history
  • Loading branch information
enisdenjo committed Nov 11, 2022
1 parent bf091ed commit 87b95b1
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions scripts/override-graphql-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,36 @@ const graphql15AndLess = parseInt(graphqlVersion.split('.')[0]) <= 15
;[`examples/apollo-federation`].forEach((testPath) => {
if (graphql15AndLess) {
// disable
fs.renameSync(
path.resolve(__dirname, '..', testPath, '__integration-tests__'),
path.resolve(__dirname, '..', testPath, '__DISABLED_integration-tests__'),
const testPathAbs = path.resolve(
__dirname,
'..',
testPath,
'__integration-tests__',
)
if (fs.existsSync(testPathAbs)) {
fs.renameSync(
testPathAbs,
path.resolve(
__dirname,
'..',
testPath,
'__DISABLED_integration-tests__',
),
)
}
} else {
// enable if disabled
fs.renameSync(
path.resolve(__dirname, '..', testPath, '__DISABLED_integration-tests__'),
path.resolve(__dirname, '..', testPath, '__integration-tests__'),
const testPathAbs = path.resolve(
__dirname,
'..',
testPath,
'__DISABLED_integration-tests__',
)
if (fs.existsSync(testPathAbs)) {
fs.renameSync(
testPathAbs,
path.resolve(__dirname, '..', testPath, '__integration-tests__'),
)
}
}
})

0 comments on commit 87b95b1

Please sign in to comment.