1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2024-11-05 09:56:22 +00:00
HackMyResume/test/test-themes.js

74 lines
2.8 KiB
JavaScript
Raw Normal View History

2015-12-09 10:41:04 +00:00
var SPAWNWATCHER = require('../src/core/spawn-watch')
, chai = require('chai')
2015-12-09 10:41:04 +00:00
, expect = chai.expect
, should = chai.should()
, path = require('path')
, _ = require('underscore')
, FRESHResume = require('../src/core/fresh-resume')
2015-12-19 17:37:42 +00:00
, FCMD = require( '../src/hackmycmd')
2015-12-09 10:41:04 +00:00
, validator = require('is-my-json-valid')
, COLORS = require('colors');
chai.config.includeStack = false;
describe('Testing themes', function () {
var _sheet;
COLORS.setTheme({
title: ['white','bold'],
info: process.platform === 'win32' ? 'gray' : ['white','dim'],
infoBold: ['white','dim'],
warn: 'yellow',
error: 'red',
guide: 'yellow',
status: 'gray',//['white','dim'],
useful: 'green',
});
function genTheme( fmt, src, themeName, themeLoc, testTitle ) {
themeLoc = themeLoc || themeName;
testTitle = themeName.toUpperCase() + ' theme should generate without throwing an exception';
it( testTitle, function () {
2015-12-12 16:13:37 +00:00
function tryOpen() {
//var src = ['node_modules/jane-q-fullstacker/resume/jane-resume.json'];
var dst = ['test/sandbox/' + fmt + '/' + themeName + '/resume.all'];
2015-12-12 16:13:37 +00:00
var opts = {
theme: themeLoc,
format: fmt,
2015-12-12 16:13:37 +00:00
prettify: true,
2015-12-21 07:58:16 +00:00
silent: true
2015-12-12 16:13:37 +00:00
};
FCMD.verbs.build( src, dst, opts, function() {} );
2015-12-12 16:13:37 +00:00
}
tryOpen.should.not.Throw();
});
}
var src = ['node_modules/jane-q-fullstacker/resume/jane-resume.json'];
genTheme('FRESH', src, 'hello-world');
genTheme('FRESH', src, 'compact');
genTheme('FRESH', src, 'modern');
genTheme('FRESH', src, 'minimist');
genTheme('FRESH', src, 'awesome');
genTheme('FRESH', src, 'positive');
genTheme('FRESH', src, 'jsonresume-theme-boilerplate', 'node_modules/jsonresume-theme-boilerplate' );
genTheme('FRESH', src, 'jsonresume-theme-sceptile', 'node_modules/jsonresume-theme-sceptile' );
genTheme('FRESH', src, 'jsonresume-theme-modern', 'node_modules/jsonresume-theme-modern' );
genTheme('FRESH', src, 'jsonresume-theme-classy', 'node_modules/jsonresume-theme-classy' );
src = ['test/resumes/jrs-0.0.0/richard-hendriks.json'];
genTheme('JRS', src, 'hello-world');
genTheme('JRS', src, 'compact');
genTheme('JRS', src, 'modern');
genTheme('JRS', src, 'minimist');
genTheme('JRS', src, 'awesome');
genTheme('JRS', src, 'positive');
genTheme('JRS', src, 'jsonresume-theme-boilerplate', 'node_modules/jsonresume-theme-boilerplate' );
genTheme('JRS', src, 'jsonresume-theme-sceptile', 'node_modules/jsonresume-theme-sceptile' );
genTheme('JRS', src, 'jsonresume-theme-modern', 'node_modules/jsonresume-theme-modern' );
genTheme('JRS', src, 'jsonresume-theme-classy', 'node_modules/jsonresume-theme-classy' );
2015-12-09 10:41:04 +00:00
});