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

test: add test for pages #62

Merged
merged 2 commits into from
Sep 25, 2019
Merged

test: add test for pages #62

merged 2 commits into from
Sep 25, 2019

Conversation

curbengh
Copy link
Contributor

in preparation of #59.

@curbengh
Copy link
Contributor Author

I will split

    const result = generator(locals);

    result.path.should.eql('sitemap.xml');
    result.data.should.eql(sitemapTmpl.render({
      config: hexo.config,
      posts: posts.toArray().concat(pages.toArray())
    }));

    const $ = cheerio.load(result.data);
    const allPosts = Object.assign({}, posts.data.concat(pages.data));

    $('url').each((index, element) => {
      $(element).children('loc').text().should.eql(allPosts[index].permalink);
      $(element).children('lastmod').text().should.eql(allPosts[index].updated.toISOString());
    });

into two tests in a separate PR.

@coveralls
Copy link

coveralls commented Aug 11, 2019

Coverage Status

Coverage remained the same at 100.0% when pulling 816c406 on curbengh:page into c5f7c55 on hexojs:master.

@curbengh curbengh mentioned this pull request Sep 11, 2019
2 tasks
@curbengh
Copy link
Contributor Author

rebased

@curbengh curbengh merged commit a61334c into hexojs:master Sep 25, 2019
@curbengh curbengh deleted the page branch September 25, 2019 01:45
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.

3 participants