2016-07-11 12:27:15 -04:00
|
|
|
'use strict';
|
2016-07-20 11:54:47 -04:00
|
|
|
var gltfPipeline = require('gltf-pipeline').gltfPipeline;
|
2016-07-11 12:27:15 -04:00
|
|
|
var path = require('path');
|
|
|
|
var convert = require('../../lib/convert');
|
|
|
|
|
|
|
|
var objFile = './specs/data/BoxTextured/BoxTextured.obj';
|
|
|
|
var gltfFile = './specs/data/BoxTextured/BoxTextured.gltf';
|
|
|
|
|
|
|
|
describe('convert', function() {
|
|
|
|
it('converts an obj to gltf', function(done) {
|
2016-07-20 11:54:47 -04:00
|
|
|
var spy = spyOn(gltfPipeline, 'processJSONToDisk').and.callFake(function(gltf, gltfFile, options, callback) {
|
2016-07-11 12:27:15 -04:00
|
|
|
callback();
|
|
|
|
});
|
|
|
|
convert(objFile, gltfFile, {}, function() {
|
2016-07-20 11:54:47 -04:00
|
|
|
var args = spy.calls.first().args;
|
|
|
|
expect(args[0]).toBeDefined();
|
|
|
|
expect(path.normalize(args[1])).toEqual(path.normalize(gltfFile));
|
2016-07-11 12:27:15 -04:00
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|