Skip to content
This repository was archived by the owner on Mar 26, 2018. It is now read-only.

test(hashmap): extract the hashmap fixtures #65

Closed

Conversation

stephanebachelier
Copy link
Contributor

Make tests more robusts as there is a test in Gruntfile and should help the PR #38

Make tests more robusts as there is a test in Gruntfile and should help
the PR yeoman#38
@eddiemonge
Copy link
Member

Still just as brittle as things could change the hash.

@eddiemonge eddiemonge closed this Nov 13, 2014
@stephanebachelier
Copy link
Contributor Author

@eddiemonge The goal of grouping the hashmap in a JSON file, is to avoid duplication of hashes in test.js and in Gruntfile.js, and to update the hashes in an unique place.
It is brittle but at least it would make the developer life easier, without any duplication. And updating a hash would only require changing the hash of the file in the hashes.json.

Maybe I'm wrong, but for me the failing test which blocks the #38 is caused by this hash duplication.

@eddiemonge
Copy link
Member

A better solution would be to not use hashes at all

@stephanebachelier
Copy link
Contributor Author

@eddiemonge I agree but how would you validate with determinism that filerev work as expected ?
Filerev create an hash based on the content of a file, so if the file change, the hash change. It's the developer responsability to update the hash if any fixtures change to validate all tests.

This problem is also present in some others grunt plugins and others projects where you should compare a produced output with a set of fixtures.

@eddiemonge
Copy link
Member

the hash is based on whatever crypto thinks it should be so it could be different without any changes to the file. I would scan the output directory for the base file name plus what the expected hash string should look like and then match that up to what is the summary for the task. If they match then the test is good.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants