2016-07-11 12:27:15 -04:00
|
|
|
'use strict';
|
2016-07-22 14:09:13 -04:00
|
|
|
var Promise = require('bluebird');
|
|
|
|
|
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-22 16:17:27 -04:00
|
|
|
var spy = spyOn(gltfPipeline, 'processJSONToDisk').and.callFake(function(gltf, outputPath, options, callback) {
|
2016-07-22 14:09:13 -04:00
|
|
|
return;
|
2016-07-11 12:27:15 -04:00
|
|
|
});
|
2016-07-22 14:09:13 -04:00
|
|
|
expect(convert(objFile, gltfFile, {})
|
|
|
|
.then(function() {
|
|
|
|
var args = spy.calls.first().args;
|
|
|
|
expect(args[0]).toBeDefined();
|
|
|
|
expect(path.normalize(args[1])).toEqual(path.normalize(gltfFile));
|
|
|
|
}), done).toResolve();
|
2016-07-11 12:27:15 -04:00
|
|
|
});
|
|
|
|
});
|