Skip to content

Conversation

@bajtos
Copy link
Member

@bajtos bajtos commented Feb 16, 2018

Relax the assertions performed by the test to allow changes reorganizing files around.

Rework the test to async/await style, now that we no longer support Node.js 6.x

Change the sandbox directory from "test/sandbox" to ".sandbox" to prevent interference with code scanning "test" for test files to run.

This is a follow-up for #1003 which disabled this problematic test.

Checklist

  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • Related API Documentation was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in packages/example-* were updated

@bajtos bajtos added this to the February 2018 milestone Feb 16, 2018
@bajtos bajtos self-assigned this Feb 16, 2018
@bajtos bajtos requested a review from shimks as a code owner February 16, 2018 13:02
Copy link
Contributor

@shimks shimks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just one thing that was missed I think.

@@ -0,0 +1 @@
.sandbox
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can bring this up to the root-level IIRC

Copy link
Contributor

@kjdelisle kjdelisle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In hindsight, I should've made the commit look like this rather than disabling the test.

I'd agree with @shimks ' review, just that one minor fixup but otherwise it's good to go.

EDIT: Your commit message is missing the colon between the scope and change statement, and the change statement must start with a lowercase letter.
fix(cli): add back the test for cloneExampleFromGithub

@kjdelisle kjdelisle force-pushed the fix/clone-example-test branch from 0c481f6 to cbda602 Compare February 16, 2018 16:32
@kjdelisle
Copy link
Contributor

I've made an amendment to the commit to fixup the message.

Relax the assertions performed by the test to allow changes
reorganizing files around.

Rework the test to async/await style, now that we no longer support
Node.js 6.x

Change the sandbox directory from "test/sandbox" to ".sandbox" to
prevent interference with code scanning "test" for test files to run.
@kjdelisle kjdelisle force-pushed the fix/clone-example-test branch from cbda602 to 35a97a6 Compare February 16, 2018 16:34
@kjdelisle
Copy link
Contributor

I've also applied the feedback and hoisted the .sandbox into the top-level ignore. Normally, I'd leave this alone, but I do want to get that test coverage back online ASAP (I hate disabling tests for any but the very best of reasons).

Copy link
Contributor

@virkt25 virkt25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Two comments, not blockers but would help with consistency imo.

let sandbox;

describe.skip('cloneExampleFromGitHub (SLOW)', function() {
describe('cloneExampleFromGitHub (SLOW)', function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove the word function and use describe('cloneExampleFromGitHub (SLOW)', () => { to be consistent with the code base.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot - the next line is calling this.timeout(). This is one of the gotchas of using arrow functions with Mocha.

'src/index.ts',
]);

const packageJson = JSON.parse(fs.readFileSync(`${outDir}/package.json`));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might make sense to promisify readFile and use that with await to be consistent?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed - see f0125c9

@bajtos
Copy link
Member Author

bajtos commented Feb 19, 2018

We can bring this up to the root-level IIRC

I personally prefer to keep package-specific gitignore entries in packages/{name}/.gitignore. Not a big deal though, since the rest of the team seems to prefer all entries in the monorepo-level file, I am ok to follow.

@bajtos bajtos merged commit d43b35d into master Feb 19, 2018
@bajtos bajtos deleted the fix/clone-example-test branch February 19, 2018 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants