Initial preview rendering

This commit is contained in:
Berkeley Martinez
2016-05-20 12:42:26 -07:00
parent 1db5caa701
commit 9b7bd2a026
24 changed files with 475 additions and 159 deletions

View File

@@ -40,13 +40,21 @@ export function buildSeed({ challengeSeed = [] } = {}) {
}
const pathsMap = {
[HTML]: 'main.html',
[JS]: 'main.js',
[BONFIRE]: 'main.js'
[HTML]: 'html',
[JS]: 'js',
[BONFIRE]: 'js'
};
export function getPath({ challengeType }) {
return pathsMap[challengeType] || 'main';
export function getPreFile({ challengeType }) {
return {
name: 'index',
ext: pathsMap[challengeType] || 'html',
key: getFileKey({ challengeType })
};
}
export function getFileKey({ challengeType }) {
return 'index' + (pathsMap[challengeType] || 'html');
}
export function createTests({ tests = [] }) {