You've already forked hugo-extended
mirror of
https://github.com/jakejarvis/hugo-extended.git
synced 2025-10-16 12:14:26 -04:00
tests: use for of
This commit is contained in:
@@ -34,25 +34,28 @@ hugoLibCustomRepoTestSuite('verify test env', () => {
|
|||||||
|
|
||||||
hugoLibCustomRepoTestSuite('should return default repository url - Repository: default - Extended: undefined', () => {
|
hugoLibCustomRepoTestSuite('should return default repository url - Repository: default - Extended: undefined', () => {
|
||||||
const repoSources = hugoLib(process.cwd())._src.map((v) => v.url);
|
const repoSources = hugoLib(process.cwd())._src.map((v) => v.url);
|
||||||
repoSources.forEach((sourceUrl) => {
|
|
||||||
|
for (const sourceUrl of repoSources) {
|
||||||
assert.ok(sourceUrl.startsWith('https://github.com/'));
|
assert.ok(sourceUrl.startsWith('https://github.com/'));
|
||||||
});
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
hugoLibCustomRepoTestSuite('should return default repository url - Repository: default - Extended: empty', () => {
|
hugoLibCustomRepoTestSuite('should return default repository url - Repository: default - Extended: empty', () => {
|
||||||
process.env.npm_config_hugo_bin_build_tags = '';
|
process.env.npm_config_hugo_bin_build_tags = '';
|
||||||
const repoSources = hugoLib(process.cwd())._src.map((v) => v.url);
|
const repoSources = hugoLib(process.cwd())._src.map((v) => v.url);
|
||||||
repoSources.forEach((sourceUrl) => {
|
|
||||||
|
for (const sourceUrl of repoSources) {
|
||||||
assert.ok(sourceUrl.startsWith('https://github.com/'));
|
assert.ok(sourceUrl.startsWith('https://github.com/'));
|
||||||
});
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
hugoLibCustomRepoTestSuite('should return default repository url - Repository: default - Extended: extended', () => {
|
hugoLibCustomRepoTestSuite('should return default repository url - Repository: default - Extended: extended', () => {
|
||||||
process.env.npm_config_hugo_bin_build_tags = 'extended';
|
process.env.npm_config_hugo_bin_build_tags = 'extended';
|
||||||
const repoSources = hugoLib(process.cwd())._src.map((v) => v.url);
|
const repoSources = hugoLib(process.cwd())._src.map((v) => v.url);
|
||||||
repoSources.forEach((sourceUrl) => {
|
|
||||||
|
for (const sourceUrl of repoSources) {
|
||||||
assert.ok(sourceUrl.startsWith('https://github.com/'));
|
assert.ok(sourceUrl.startsWith('https://github.com/'));
|
||||||
});
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Custom/Enterprise Repository Test Cases
|
// Custom/Enterprise Repository Test Cases
|
||||||
@@ -60,27 +63,30 @@ hugoLibCustomRepoTestSuite('should return default repository url - Repository: d
|
|||||||
hugoLibCustomRepoTestSuite('should return custom repository url - Repository: custom - Extended: undefined', () => {
|
hugoLibCustomRepoTestSuite('should return custom repository url - Repository: custom - Extended: undefined', () => {
|
||||||
process.env.npm_config_hugo_bin_download_repo = 'https://some1.example.com';
|
process.env.npm_config_hugo_bin_download_repo = 'https://some1.example.com';
|
||||||
const repoSources = hugoLib(process.cwd())._src.map((v) => v.url);
|
const repoSources = hugoLib(process.cwd())._src.map((v) => v.url);
|
||||||
repoSources.forEach((sourceUrl) => {
|
|
||||||
|
for (const sourceUrl of repoSources) {
|
||||||
assert.ok(sourceUrl.startsWith('https://some1.example.com/'));
|
assert.ok(sourceUrl.startsWith('https://some1.example.com/'));
|
||||||
});
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
hugoLibCustomRepoTestSuite('should return custom repository url - Repository: custom - Extended: empty', () => {
|
hugoLibCustomRepoTestSuite('should return custom repository url - Repository: custom - Extended: empty', () => {
|
||||||
process.env.npm_config_hugo_bin_build_tags = '';
|
process.env.npm_config_hugo_bin_build_tags = '';
|
||||||
process.env.npm_config_hugo_bin_download_repo = 'https://some2.example.com';
|
process.env.npm_config_hugo_bin_download_repo = 'https://some2.example.com';
|
||||||
const repoSources = hugoLib(process.cwd())._src.map((v) => v.url);
|
const repoSources = hugoLib(process.cwd())._src.map((v) => v.url);
|
||||||
repoSources.forEach((sourceUrl) => {
|
|
||||||
|
for (const sourceUrl of repoSources) {
|
||||||
assert.ok(sourceUrl.startsWith('https://some2.example.com/'));
|
assert.ok(sourceUrl.startsWith('https://some2.example.com/'));
|
||||||
});
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
hugoLibCustomRepoTestSuite('should return custom repository url - Repository: custom - Extended: extended', () => {
|
hugoLibCustomRepoTestSuite('should return custom repository url - Repository: custom - Extended: extended', () => {
|
||||||
process.env.npm_config_hugo_bin_build_tags = 'extended';
|
process.env.npm_config_hugo_bin_build_tags = 'extended';
|
||||||
process.env.npm_config_hugo_bin_download_repo = 'https://some3.example.com';
|
process.env.npm_config_hugo_bin_download_repo = 'https://some3.example.com';
|
||||||
const repoSources = hugoLib(process.cwd())._src.map((v) => v.url);
|
const repoSources = hugoLib(process.cwd())._src.map((v) => v.url);
|
||||||
repoSources.forEach((sourceUrl) => {
|
|
||||||
|
for (const sourceUrl of repoSources) {
|
||||||
assert.ok(sourceUrl.startsWith('https://some3.example.com/'));
|
assert.ok(sourceUrl.startsWith('https://some3.example.com/'));
|
||||||
});
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
hugoLibCustomRepoTestSuite.run();
|
hugoLibCustomRepoTestSuite.run();
|
||||||
|
Reference in New Issue
Block a user