mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-09 04:22:07 +00:00
This reverts #8381 and instead supports the "2.7.x" syntax. - Related to https://github.com/vercel/customer-issues/issues/684
42 lines
1.2 KiB
JavaScript
Vendored
42 lines
1.2 KiB
JavaScript
Vendored
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const {
|
|
testDeployment,
|
|
} = require('../../../test/lib/deployment/test-deployment.js');
|
|
|
|
jest.setTimeout(5 * 60 * 1000);
|
|
|
|
const fixturesPath = path.resolve(__dirname, 'fixtures');
|
|
|
|
const testsThatFailToBuild = new Map([
|
|
[
|
|
'11-version-2-5-error',
|
|
'Found `Gemfile` with discontinued Ruby version: `ruby "~> 2.5.x".` Please set `ruby "~> 2.7.x"` in your `Gemfile` to use Ruby 2.7.x.',
|
|
],
|
|
]);
|
|
|
|
// eslint-disable-next-line no-restricted-syntax
|
|
for (const fixture of fs.readdirSync(fixturesPath)) {
|
|
const errMsg = testsThatFailToBuild.get(fixture);
|
|
if (errMsg) {
|
|
// eslint-disable-next-line no-loop-func
|
|
it(`should fail to build ${fixture}`, async () => {
|
|
try {
|
|
await testDeployment(path.join(fixturesPath, fixture));
|
|
} catch (err) {
|
|
expect(err).toBeTruthy();
|
|
expect(err.deployment).toBeTruthy();
|
|
expect(err.deployment.errorMessage).toBe(errMsg);
|
|
}
|
|
});
|
|
continue; //eslint-disable-line
|
|
}
|
|
// eslint-disable-next-line no-loop-func
|
|
it(`should build ${fixture}`, async () => {
|
|
await expect(
|
|
testDeployment(path.join(fixturesPath, fixture))
|
|
).resolves.toBeDefined();
|
|
});
|
|
}
|