<commit_before>var _app = new app();
var category = _app.pages.category;

casper.test.begin('Canonical Link is set on categories pages', _app.categories.length, function suite(test) {
	var categoriesUrls = _app.categories.map(function(slug) {
		return category.url(slug);
	});
    casper.start().each(categoriesUrls, function(self, link) {
		self.thenOpen(link, function() {
			utils.dump(link);
			test.assertExists('link[rel=canonical]', "Canonical link is set");
		})
	})
	.run(function() {
		test.done();
    });
});<commit_msg>Avoid test failing if no category set.<commit_after>var _app = new app();
var category = _app.pages.category;

casper.test.begin('Canonical Link is set on categories pages', _app.categories.length, function suite(test) {
	var categoriesUrls = _app.categories.map(function(slug) {
		return category.url(slug);
	});
	if (categoriesUrls.length == 0) {
		test.skip(1, 'No category found.');
	} else {
		casper.start().each(categoriesUrls, function(self, link) {
			self.thenOpen(link, function() {
				test.assertExists('link[rel=canonical]', "Canonical link is set");
			})
		})
		.run(function() {
			test.done();
		});
	}
});
{'fraction_non_alphanumeric': 0.1643598615916955, 'fraction_numerical': 0.0017301038062283738, 'mean_word_length': 4.616504854368932, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6674830', 'n_tokens_mistral': 408, 'n_tokens_neox': 386, 'n_words': 83}