test(global-data): Add test for using global data #80
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.
TL;DR
Tried adding a test for using global data in a WebC component.
I think it’s close, but I can’t quite get it to work.
Background
I love WebC…but I’m having a dickens of a time trying to accomplish simple things in an existing project.
I thought to myself, “Self, you can’t seem to access global data in your existing project. I bet you could look at the tests for the Eleventy WebC plugin and figure out how it works!”
Just looking at the test titles, I couldn’t find a test that did that. (That said, some of the test titles are more descriptive than others, so it’s possible that I missed something.) So I wrote a new test, but I can’t get it to output the data in any useful way. I just keep getting
[object Object]
.“Help me, Obi Wan @zachleat: You’re my only hope!”
—Me