Fix tests

This commit is contained in:
Sean Lilley 2017-04-20 14:55:47 -04:00
parent d7a354b313
commit 1ccf070a6e
2 changed files with 6 additions and 4 deletions

View File

@ -70,7 +70,7 @@ describe('gltf', function() {
it('simple gltf', function(done) { it('simple gltf', function(done) {
var gltf = createGltf(boxObjData); var gltf = createGltf(boxObjData);
expect(writeUris(gltf, boxGltfUrl, defaultOptions) expect(writeUris(gltf, boxGltfUrl, path.dirname(boxGltfUrl), defaultOptions)
.then(function() { .then(function() {
expect(gltf).toEqual(boxGltf); expect(gltf).toEqual(boxGltf);
}), done).toResolve(); }), done).toResolve();
@ -79,7 +79,7 @@ describe('gltf', function() {
it('multiple nodes, meshes, and primitives', function(done) { it('multiple nodes, meshes, and primitives', function(done) {
var gltf = createGltf(groupObjData); var gltf = createGltf(groupObjData);
expect(writeUris(gltf, groupGltfUrl, defaultOptions) expect(writeUris(gltf, groupGltfUrl, path.dirname(groupGltfUrl), defaultOptions)
.then(function() { .then(function() {
expect(gltf).toEqual(groupGltf); expect(gltf).toEqual(groupGltf);
expect(Object.keys(gltf.materials).length).toBe(3); expect(Object.keys(gltf.materials).length).toBe(3);

View File

@ -29,9 +29,10 @@ describe('obj2gltf', function() {
.then(function() { .then(function() {
var args = spy.calls.first().args; var args = spy.calls.first().args;
var options = args[2]; var options = args[2];
expect(options.basePath).toBeDefined();
delete options.basePath; // This will be a random temp directory
expect(options).toEqual({ expect(options).toEqual({
createDirectory : false, createDirectory : false,
basePath : path.dirname(objPath),
binary : false, binary : false,
embed : true, embed : true,
embedImage : true, embedImage : true,
@ -75,9 +76,10 @@ describe('obj2gltf', function() {
.then(function() { .then(function() {
var args = spy.calls.first().args; var args = spy.calls.first().args;
var options = args[2]; var options = args[2];
expect(options.basePath).toBeDefined();
delete options.basePath; // This will be a random temp directory
expect(options).toEqual({ expect(options).toEqual({
createDirectory : false, createDirectory : false,
basePath : path.dirname(objPath),
binary : true, binary : true,
embed : false, embed : false,
embedImage : false, embedImage : false,