Comparing version 0.1.0 to 0.2.0
{ | ||
"name": "obj2json", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Convert Wavefront .obj files to Three.js JSON format, using Blender", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
/* eslint-env node, mocha */ | ||
var fs = require("fs"); | ||
var mockery = require("mockery"); | ||
@@ -209,5 +210,3 @@ var assert = require("assert"); | ||
assert.equal(result, undefined); | ||
assert.equal( | ||
err.message, | ||
"ENOENT: no such file or directory, access 'baz'"); | ||
assert.equal(err.message.slice(0, 6), "ENOENT"); | ||
done(); | ||
@@ -244,3 +243,21 @@ }); | ||
}); | ||
it("should handle textures too", function(done) { | ||
var opts = { | ||
inputFile: relativePath("BHS04.obj"), | ||
outputFile: relativePath("BHS04.json") | ||
}; | ||
obj2json(opts, function(err, result) { | ||
if (err) { | ||
return done(err); | ||
} | ||
var resultBuffer = fs.readFileSync(result); | ||
var resultString = resultBuffer.toString(); | ||
var resultData = JSON.parse(resultString); | ||
assert.equal(resultData.materials.some(function(material) { | ||
return (material.mapDiffuse === "PythBHS.jpg"); | ||
}), true); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
17112141
151
6757
52
3