1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2024-09-29 04:29:12 +01:00

Update tests.

This commit is contained in:
hacksalot 2015-12-18 15:34:30 -05:00
parent 0e47f02a33
commit 759dcc30e7
5 changed files with 12 additions and 8 deletions

View File

@ -59,6 +59,7 @@
"grunt-contrib-yuidoc": "^0.10.0", "grunt-contrib-yuidoc": "^0.10.0",
"grunt-simple-mocha": "*", "grunt-simple-mocha": "*",
"is-my-json-valid": "^2.12.2", "is-my-json-valid": "^2.12.2",
"jane-q-fullstacker": "fluentdesk/jane-q-fullstacker",
"mocha": "*", "mocha": "*",
"resample": "fluentdesk/resample" "resample": "fluentdesk/resample"
} }

View File

@ -7,6 +7,7 @@ var chai = require('chai')
, FRESHResume = require('../src/core/fresh-resume') , FRESHResume = require('../src/core/fresh-resume')
, CONVERTER = require('../src/core/convert') , CONVERTER = require('../src/core/convert')
, FS = require('fs') , FS = require('fs')
, MKDIRP = require('mkdirp')
, _ = require('underscore'); , _ = require('underscore');
chai.config.includeStack = false; chai.config.includeStack = false;
@ -21,6 +22,7 @@ describe('FRESH/JRS converter', function () {
var fileB = path.join( __dirname, 'sandbox/richard-hendriks.json' ); var fileB = path.join( __dirname, 'sandbox/richard-hendriks.json' );
_sheet = new FRESHResume().open( fileA ); _sheet = new FRESHResume().open( fileA );
MKDIRP.sync( path.parse(fileB).dir );
_sheet.saveAs( fileB, 'JRS' ); _sheet.saveAs( fileB, 'JRS' );
var rawA = FS.readFileSync( fileA, 'utf8' ); var rawA = FS.readFileSync( fileA, 'utf8' );

View File

@ -16,7 +16,7 @@ describe('jane-doe.json (FRESH)', function () {
it('should open without throwing an exception', function () { it('should open without throwing an exception', function () {
function tryOpen() { function tryOpen() {
_sheet = new FRESHResume().open( _sheet = new FRESHResume().open(
'node_modules/FRESCA/exemplar/jane-doe.json' ); 'node_modules/jane-q-fullstacker/resume/jane-resume.json' );
} }
tryOpen.should.not.Throw(); tryOpen.should.not.Throw();
}); });
@ -43,13 +43,13 @@ describe('jane-doe.json (FRESH)', function () {
it('should save without throwing an exception', function(){ it('should save without throwing an exception', function(){
function trySave() { function trySave() {
_sheet.save( 'tests/sandbox/jane-doe.json' ); _sheet.save( 'tests/sandbox/jane-q-fullstacker.json' );
} }
trySave.should.not.Throw(); trySave.should.not.Throw();
}); });
it('should not be modified after saving', function() { it('should not be modified after saving', function() {
var savedSheet = new FRESHResume().open('tests/sandbox/jane-doe.json'); var savedSheet = new FRESHResume().open('tests/sandbox/jane-q-fullstacker.json');
_sheet.stringify().should.equal( savedSheet.stringify() ) _sheet.stringify().should.equal( savedSheet.stringify() )
}); });

View File

@ -16,7 +16,7 @@ describe('jane-doe.json (JRS)', function () {
it('should open without throwing an exception', function () { it('should open without throwing an exception', function () {
function tryOpen() { function tryOpen() {
_sheet = new JRSResume().open( _sheet = new JRSResume().open(
path.join( __dirname, 'resumes/jrs/jane-doe.json' ) ); path.join( __dirname, 'resumes/jrs/jane-q-fullstacker.json' ) );
} }
tryOpen.should.not.Throw(); tryOpen.should.not.Throw();
}); });
@ -39,13 +39,13 @@ describe('jane-doe.json (JRS)', function () {
it('should save without throwing an exception', function(){ it('should save without throwing an exception', function(){
function trySave() { function trySave() {
_sheet.save( 'tests/sandbox/jane-doe.json' ); _sheet.save( 'tests/sandbox/jane-q-fullstacker.json' );
} }
trySave.should.not.Throw(); trySave.should.not.Throw();
}); });
it('should not be modified after saving', function() { it('should not be modified after saving', function() {
var savedSheet = new JRSResume().open( 'tests/sandbox/jane-doe.json' ); var savedSheet = new JRSResume().open( 'tests/sandbox/jane-q-fullstacker.json' );
_sheet.stringify().should.equal( savedSheet.stringify() ) _sheet.stringify().should.equal( savedSheet.stringify() )
}); });

View File

@ -29,8 +29,8 @@ describe('Testing themes', function () {
function genTheme( themeName ) { function genTheme( themeName ) {
it( themeName.toUpperCase() + ' theme should generate without throwing an exception', function () { it( themeName.toUpperCase() + ' theme should generate without throwing an exception', function () {
function tryOpen() { function tryOpen() {
var src = ['node_modules/FRESCA/exemplar/jane-doe.json']; var src = ['node_modules/jane-q-fullstacker/resume/jane-resume.json'];
var dst = ['tests/sandbox/hello-world/resume.all']; var dst = ['tests/sandbox/' + themeName + '/resume.all'];
var opts = { var opts = {
theme: themeName, theme: themeName,
format: 'FRESH', format: 'FRESH',
@ -48,5 +48,6 @@ describe('Testing themes', function () {
genTheme('modern'); genTheme('modern');
genTheme('minimist'); genTheme('minimist');
genTheme('awesome'); genTheme('awesome');
genTheme('positive');
}); });