Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure babel-cli tests compare generated output with out-files #5205

Merged
merged 1 commit into from
Mar 23, 2017

Conversation

existentialism
Copy link
Member

@existentialism existentialism commented Jan 24, 2017

Q A
Patch: Bug Fix? no
Major: Breaking Change? no
Minor: New Feature? no
Deprecations? no
Spec Compliancy? no
Tests Added/Pass? yes
Fixed Tickets
License MIT
Doc PR
Dependency Changes

Summary:

  • Allow passing of a filter to readDir, which enables us to include dotfiles when creating opts.inFiles and opts.outFiles
  • Compare compiled output with out-files for matching, missing and extraneous files

While digging a little deeper into #5083, I noticed that babel-cli tests were only comparing out-files to generated (and not vice versa), which doesn't check for missing or extraneous files.

This would make testing --copy-files and the potential new --copy-dot-files flags hard :)

This should also allow us to write more comprehensive tests for babel-cli.

@existentialism existentialism added the PR: Internal 🏠 A type of pull request used for our changelog categories label Jan 24, 2017
@mention-bot
Copy link

@existentialism, thanks for your PR! By analyzing the history of the files in this pull request, we identified @hzoo, @DrewML and @zertosh to be potential reviewers.

@codecov-io
Copy link

codecov-io commented Jan 24, 2017

Codecov Report

Merging #5205 into 7.0 will increase coverage by 0.04%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##              7.0    #5205      +/-   ##
==========================================
+ Coverage   85.39%   85.43%   +0.04%     
==========================================
  Files         201      201              
  Lines        9483     9483              
  Branches     2688     2688              
==========================================
+ Hits         8098     8102       +4     
+ Misses        892      890       -2     
+ Partials      493      491       -2
Impacted Files Coverage Δ
packages/babel-traverse/src/path/context.js 86.2% <0%> (-0.87%)
packages/babel-cli/src/babel/dir.js 68.29% <0%> (+12.19%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 39c862c...06c219a. Read the comment docs.

@@ -13,6 +13,10 @@ const fs = require("fs");
const fixtureLoc = path.join(__dirname, "fixtures");
const tmpLoc = path.join(__dirname, "tmp");

const fileFilter = function(x) {
return x !== ".DS_Store";
Copy link
Member

Choose a reason for hiding this comment

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

I guess this was making interference during the tests. Since .DS_Store are ignored in Git I think this shouldn't happen so often.

@existentialism
Copy link
Member Author

Updated to include some tests for the new ignore/only behavior with --copy-files introduced in #5487.

@hzoo hzoo merged commit c687b70 into babel:7.0 Mar 23, 2017
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 6, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Internal 🏠 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants