This commit is contained in:
Sean Lilley 2016-07-20 11:54:47 -04:00
parent ad0866efde
commit 5d8d3c0098
2 changed files with 5 additions and 306 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
'use strict';
var fs = require('fs');
var gltfPipeline = require('gltf-pipeline').gltfPipeline;
var path = require('path');
var convert = require('../../lib/convert');
@ -8,12 +8,13 @@ var gltfFile = './specs/data/BoxTextured/BoxTextured.gltf';
describe('convert', function() {
it('converts an obj to gltf', function(done) {
var spy = spyOn(fs, 'writeFile').and.callFake(function(file, data, callback) {
var spy = spyOn(gltfPipeline, 'processJSONToDisk').and.callFake(function(gltf, gltfFile, options, callback) {
callback();
});
convert(objFile, gltfFile, {}, function() {
expect(path.normalize(spy.calls.first().args[0])).toEqual(path.normalize(gltfFile));
var args = spy.calls.first().args;
expect(args[0]).toBeDefined();
expect(path.normalize(args[1])).toEqual(path.normalize(gltfFile));
done();
});
});