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

add test for pr #2367 #2369

Merged
merged 1 commit into from May 9, 2022
Merged

add test for pr #2367 #2369

merged 1 commit into from May 9, 2022

Conversation

epelc
Copy link
Contributor

@epelc epelc commented May 6, 2022

I added a test for previous pr #2367 as per @zachleat.

It doesn't actually fail though on the old code as it only runs a single template file. I wasn't sure how to run multiple template files but this is everything else that's required. You need at least 2 pages to be rendered since this is an order of execution bug.

It does at least add a test for shortcodes which I think was missing anyways.

@zachleat
Copy link
Member

zachleat commented May 6, 2022

Ah hey sorry, I’d recommend just adding a top level one like this

test("Paginated template uses proxy and global data", async (t) => {
let elev = new Eleventy(
"./test/proxy-pagination-globaldata/",
"./test/proxy-pagination-globaldata/_site",
{
config: function (eleventyConfig) {},
}
);
let results = await elev.toJSON();
let allContentMatches = results.filter((entry) => {
return entry.content.trim() === "BANNER TEXT";
});
t.is(results.length, allContentMatches.length);
});

then just add a few template files in a stubs folder

@zachleat zachleat merged commit bb9caeb into 11ty:master May 9, 2022
@zachleat
Copy link
Member

zachleat commented May 9, 2022

Fixed this! Got the test breaking and then it is fixed with the code from #2367.

Thank you again!

@zachleat zachleat added this to the Eleventy 1.0.2 milestone May 9, 2022
@epelc
Copy link
Contributor Author

epelc commented May 9, 2022

Thanks @zachleat!

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

Successfully merging this pull request may close these issues.

None yet

2 participants