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

Refactor #86

Merged
merged 23 commits into from
Apr 26, 2018
Merged

Refactor #86

merged 23 commits into from
Apr 26, 2018

Conversation

mog13
Copy link
Owner

@mog13 mog13 commented Apr 21, 2018

Changed or moved almost everything! should be a bit easier to follow and reason about now :).

obviously loads of changes and things I've probably forgotten about but a few important things:

A few things may look like they've been removed, for instance variables and dictionary contexts, but are just implemented in a slightly differently now. Changed splain.process to take in an options parameter to keep new features neater and stop parameter creep. This means variables and the newly named dictionaryName can be passed in with that. There are examples in the tests.

 it("should handle variable template resolution", () => {
     let variables = {test: () =>1+2};
     let result = splainInstance.process("{{##test}}", {variables});
     expect(result).toBe("3");
});

A couple of things have been removed. I took the caching out as it was causing us problems and not sure the pay off was worth it. An array.reduce should be quick enough. I also removed previous resolutions with a view to implement a more detailed output mechanism in the near future.

Also moved any tests that were testing Splain as a whole out of the lib folder. These are now at the root level in splain.test. Cool thing about this is it then runs the tests over both the compiled version and the library!

(still working out a few things with context ordering so not actually ready for merge just thought you might wanna check it out 😄 )

@mog13 mog13 requested a review from luke-rogers April 21, 2018 17:21
@codecov
Copy link

codecov bot commented Apr 21, 2018

Codecov Report

Merging #86 into master will increase coverage by 0.7%.
The diff coverage is 98.58%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master      #86     +/-   ##
=========================================
+ Coverage   97.75%   98.46%   +0.7%     
=========================================
  Files           9       12      +3     
  Lines         267      260      -7     
  Branches       76       80      +4     
=========================================
- Hits          261      256      -5     
+ Misses          6        4      -2
Impacted Files Coverage Δ
lib/tokenFinder.js 100% <100%> (ø)
lib/config.js 100% <100%> (ø)
lib/token.js 100% <100%> (ø)
lib/entryProcessor.js 100% <100%> (ø)
lib/splain.js 95.23% <100%> (+6.34%) ⬆️
lib/templateFinder.js 100% <100%> (ø) ⬆️
lib/processor.js 100% <100%> (ø)
lib/dictionary.js 100% <100%> (ø) ⬆️
lib/literalFinder.js 100% <100%> (ø)
lib/templateStripper.js 100% <100%> (ø)
... and 8 more

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 ee35137...605a069. Read the comment docs.

@mog13
Copy link
Owner Author

mog13 commented Apr 22, 2018

closes #79 , closes #81, closes #82, closes #83

@mog13
Copy link
Owner Author

mog13 commented Apr 22, 2018

closes #80

@mog13 mog13 merged commit b4de3d2 into master Apr 26, 2018
This was referenced Apr 26, 2018
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.

1 participant