Test "new" and "addon" commands output against fixtures#7595
Closed
ro0gr wants to merge 7 commits intoember-cli:masterfrom
Closed
Test "new" and "addon" commands output against fixtures#7595ro0gr wants to merge 7 commits intoember-cli:masterfrom
ro0gr wants to merge 7 commits intoember-cli:masterfrom
Conversation
5 tasks
twokul
reviewed
Feb 4, 2018
| "ember-cli-internal-test-helpers": "^0.9.0", | ||
| "eslint-plugin-chai-expect": "^1.1.1", | ||
| "eslint-plugin-mocha": "^4.8.0", | ||
| "fixturify": "^0.3.4", |
Contributor
There was a problem hiding this comment.
we should likely take advantage of broccoli-test-helpers which relies on fixturify
Contributor
Author
There was a problem hiding this comment.
I'm not actually sure which benefits does it offer here. Looks like broccoli-test-helper is intended to be used for testing of the build output diffs which is not related for testing blueprints output I think.
Of course I may miss something because I've never used broccoli-test-helper before... I'd be glad to switch to broccoli-test-helpers if there is some reason.
29 tasks
Contributor
Author
|
Closing due to current removal of MU blueprints |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #7557
It's needed to safely experiment with blueprints specifically mu-app blueprint.
There are few issues with the current
confirmBlueprintedapproach:files/directory as a single source of truth. So if we have some custom logic which filters/adds some filesconfirmBlueprinteddoesn't allow us to test this.Blueprint.renamedFileswhich is bad cause I believe that tests should not rely on the tested units.I think the main issue with this approach is that if we remove half of the blueprint files then test will continue to pass.
Also there are few more concerns:
ember-welcome. But we don't want to have the whole project fixture for each of these cases. We need a way to use a default fixture and just apply small patches to it right in the test(w/o additional fixture folder).In order to address these issues I've introduced 2 new helpers:
loadProjectFixture(fixturePaths, options)Loads the fixture from a single or multiple paths:
Under the hood it uses
fixturifyto load the files but the result is flattened for the sake of a better diff results.loadProjectFixturealso allows to filter result withfilesoption which acceptsminimatchpatterns:And finally we can patch resulting files with a
patchesoption:expectProject(expectedProjectName, fixture)It's supposed to check that the current dir has an expected name and all the file content are equal to the fixture content. It prints