Created
July 28, 2018 17:03
-
-
Save aadennis/ebccd59d02dfc89d1a8d78e0504b11ef to your computer and use it in GitHub Desktop.
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
// Hack test to prove we can return and check the contents of a file | |
var assert = require('assert') | |
var path = require('path') | |
var fs = require('fs') | |
describe('flashcard metadata checks', function () { | |
// arrange, act | |
var musicalNotesMetaData //scope | |
before(function (done) { | |
var fullPath = __dirname + '/MusicalNotes/TestArtifacts' | |
var musicalNotesMetaDataFile = fullPath + '/MusicalNotes.json' | |
fs.readFile(musicalNotesMetaDataFile, 'utf8', function (err, data) { | |
if (err) throw err; | |
musicalNotesMetaData = JSON.parse(data); | |
done() // NOTE THE LOCATION OF done(): It is in the readFile callback, not at the end of before or beforeEach | |
}); | |
}); | |
// assert | |
it('has the correct values for selected elements', function () { | |
assert.equal(musicalNotesMetaData.musicalNotes.extension, '.png') | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment