obj2gltf/specs/lib/convertSpec.js
2016-08-25 13:48:34 -04:00

24 lines
837 B
JavaScript

'use strict';
var Promise = require('bluebird');
var GltfPipeline = require('gltf-pipeline').Pipeline;
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) {
var spy = spyOn(GltfPipeline, 'processJSONToDisk').and.callFake(function(gltf, outputPath, options, callback) {
return;
});
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();
});
});