From e52f3d4b9be8c6b86164932ef891aebc5e1e5aef Mon Sep 17 00:00:00 2001 From: Sean Stares Date: Sun, 20 Sep 2020 20:35:34 -0500 Subject: [PATCH 1/2] fixed cypress test --- config/webpack/webpack.shared.js | 6 ++++-- cypress/integration/browse-projects-direct-nav.spec.js | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/config/webpack/webpack.shared.js b/config/webpack/webpack.shared.js index e7211d26..0b6da8b0 100644 --- a/config/webpack/webpack.shared.js +++ b/config/webpack/webpack.shared.js @@ -156,8 +156,10 @@ module.exports = { port: 8080 }, output: { - path: path.resolve(rootDir, 'dist'), - filename: 'js/[name].js' + chunkFilename: '[name].bundle.js', + filename: '[name].bundle.js', + path: OUTPUT_PATH, + publicPath: PUBLIC_PATH }, module: { rules: [ diff --git a/cypress/integration/browse-projects-direct-nav.spec.js b/cypress/integration/browse-projects-direct-nav.spec.js index bd24a7ab..235748a1 100644 --- a/cypress/integration/browse-projects-direct-nav.spec.js +++ b/cypress/integration/browse-projects-direct-nav.spec.js @@ -10,7 +10,9 @@ describe('browse projects page tests (direct nav)', () => { }) it('properly filters projects by language', () => { - cy.get('input[value="HTML"]') + cy.get('#language .moreLessToggle') + .click({ force: true }) + .get('input[value="HTML"]') .check({ force: true }) // using wait not ideal: https://docs.cypress.io/guides/references/best-practices.html#Unnecessary-Waiting // this will have to be refactored but was the only way I could get the test to pass From 4e961c3afbc701f45cfa54beb6f7012053c01da5 Mon Sep 17 00:00:00 2001 From: Sean Stares Date: Tue, 22 Sep 2020 14:51:31 -0500 Subject: [PATCH 2/2] Add try-catch for removal of file --- deploy.js | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/deploy.js b/deploy.js index 81107b8a..78e89d06 100644 --- a/deploy.js +++ b/deploy.js @@ -18,8 +18,15 @@ const env_vars = { } console.log('env_vars', env_vars) -console.log('unlinking ./dist/.gitignore') -fs.unlinkSync('./dist/.gitignore') + +try { + if (fs.existsSync('./dist/.gitignore')) { + console.log('unlinking ./dist/.gitignore') + fs.unlinkSync('./dist/.gitignore') + } +} catch (err) { + console.log(err) +} if (!DIR) { throw new Error('please specify CODE_GOV_DIR as an env variable') @@ -30,28 +37,27 @@ const options = { repo: process.env.CODE_GOV_REPO || 'git@github.com:GSA/code-gov-front-end' } -console.log('options:', options) - if (process.env.CODE_GOV_BRANCH) { options.branch = process.env.CODE_GOV_BRANCH } else { throw new Error('no branch specified') } -//if (!process.env.CODE_GOV_REPO) { +console.log('options:', options) +// if (!process.env.CODE_GOV_REPO) { // throw new Error("no repo specified") -//} +// } // -//if (!process.env.CODE_GOV_API_KEY) { +// if (!process.env.CODE_GOV_API_KEY) { // throw new Error("no api specified") -//} +// } -//ghpages.clean() +// ghpages.clean() // -//ghpages.publish(DIR, options, err => { +// ghpages.publish(DIR, options, err => { // if (err) { // console.error(err); // } else { // console.log("published successfully"); // } -//}); +// });