From 6bc6b3262e8ca9c93ac2ae83dc60502269d32b47 Mon Sep 17 00:00:00 2001 From: hacksalot Date: Mon, 28 Dec 2015 04:39:03 -0500 Subject: [PATCH] Add tests for FRESH/JRS cross-generation. Ability to generate JSON Resume themes from FRESH format resumes and vice-versa. --- package.json | 4 ++++ test/test-themes.js | 45 ++++++++++++++++++++++++++++++++------------- 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index ba19457..aa96010 100644 --- a/package.json +++ b/package.json @@ -77,6 +77,10 @@ "grunt-contrib-yuidoc": "^0.10.0", "grunt-simple-mocha": "*", "jane-q-fullstacker": "fluentdesk/jane-q-fullstacker", + "jsonresume-theme-boilerplate": "^0.1.2", + "jsonresume-theme-classy": "^1.0.9", + "jsonresume-theme-modern": "0.0.18", + "jsonresume-theme-sceptile": "^1.0.5", "mocha": "*", "resample": "fluentdesk/resample" } diff --git a/test/test-themes.js b/test/test-themes.js index 44fd143..8d195b3 100644 --- a/test/test-themes.js +++ b/test/test-themes.js @@ -26,28 +26,47 @@ describe('Testing themes', function () { useful: 'green', }); - function genTheme( themeName ) { - it( themeName.toUpperCase() + ' theme should generate without throwing an exception', function () { + function genTheme( fmt, src, themeName, themeLoc, testTitle ) { + themeLoc = themeLoc || themeName; + testTitle = themeName.toUpperCase() + ' theme should generate without throwing an exception'; + it( testTitle, function () { function tryOpen() { - var src = ['node_modules/jane-q-fullstacker/resume/jane-resume.json']; - var dst = ['test/sandbox/' + themeName + '/resume.all']; + //var src = ['node_modules/jane-q-fullstacker/resume/jane-resume.json']; + var dst = ['test/sandbox/' + fmt + '/' + themeName + '/resume.all']; var opts = { - theme: themeName, - format: 'FRESH', + theme: themeLoc, + format: fmt, prettify: true, silent: true }; - FCMD.verbs.build( src, dst, opts, function() { } ); + FCMD.verbs.build( src, dst, opts, function() {} ); } tryOpen.should.not.Throw(); }); } - genTheme('hello-world'); - genTheme('compact'); - genTheme('modern'); - genTheme('minimist'); - genTheme('awesome'); - genTheme('positive'); + 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' ); });