generated from luctst/luctst-cli
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Write test for checking if the choices object are well formated and c…
…heck if choices array is at the same level than template folder
- Loading branch information
Showing
1 changed file
with
16 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,19 @@ | ||
import test from "ava"; | ||
import choices from "../lib/utils/choices"; | ||
import {readdirSync} from "fs"; | ||
|
||
test("Repo-template fake test :)", t => { | ||
t.pass(); | ||
test.serial("Choices array is correct ?", t => { | ||
choices.map(el => { | ||
t.truthy(el.name); | ||
t.truthy(el.description); | ||
t.truthy(el.templateName); | ||
}); | ||
}); | ||
|
||
test.serial("Check if the choices array is at the same level than template folder", t => { | ||
const checkIfTemplate = Object.values(choices).map(el => el.templateName); | ||
|
||
readdirSync("./lib/template/").map(el => { | ||
checkIfTemplate.includes(el) ? t.pass("Same level") : t.fail("Error, check if choices hold one objet per files in template folder"); | ||
}); | ||
}); |