From a3841fe7cd1f3652f47af8ed0566f8414ba00ad2 Mon Sep 17 00:00:00 2001 From: Par Winzell Date: Sat, 23 Feb 2019 23:51:05 -0800 Subject: [PATCH] Formatting-only change. --- npm/tests/test/fbx2gltf.ts | 124 ++++++++++++++++++------------------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/npm/tests/test/fbx2gltf.ts b/npm/tests/test/fbx2gltf.ts index ea88cf2..da2ed0f 100644 --- a/npm/tests/test/fbx2gltf.ts +++ b/npm/tests/test/fbx2gltf.ts @@ -1,76 +1,76 @@ -import { readFileSync } from 'fs'; -import * as tmp from 'tmp'; -import * as path from 'path'; +import {assert, expect} from 'chai'; import * as fbx2gltf from 'fbx2gltf'; -import { assert, expect } from 'chai'; -import { validateBytes } from 'gltf-validator'; +import {readFileSync} from 'fs'; +import {validateBytes} from 'gltf-validator'; +import * as path from 'path'; +import * as tmp from 'tmp'; interface Model { - path: string; - ignoredIssues?: Array; - args?: Array; + path: string; + ignoredIssues?: Array; + args?: Array; } -const MODELS :Array = [ - { path: 'fromFacebook/Jon/jon_morph' }, - { - path: 'fromFacebook/Jon/troll-final', - ignoredIssues: [ 'ACCESSOR_NON_UNIT' ], - }, - { path: 'fromFacebook/Natalie/GlitchRobot' }, - { path: 'fromFacebook/Ocean/blackvan/blackvan_with_windows' }, - { path: 'fromFacebook/Ocean/zell_van_vertex_color' }, - { path: 'fromFacebook/RAZ/RAZ_ape' }, - { path: 'fromFbxSDK/Box' }, - { - path: 'fromFbxSDK/Humanoid', - ignoredIssues: [ 'UNSUPPORTED_EXTENSION' ], - }, - { - path: 'fromFbxSDK/Camera', - ignoredIssues: [ 'UNSUPPORTED_EXTENSION' ], - }, - { path: 'fromFbxSDK/Normals' }, - { path: 'fromGltfSamples/BoxVertexColors/BoxVertexColors' }, - { path: 'fromGltfSamples/WaterBottle/NewWaterBottle' }, +const MODELS: Array = [ + {path : 'fromFacebook/Jon/jon_morph'}, + { + path : 'fromFacebook/Jon/troll-final', + ignoredIssues : [ 'ACCESSOR_NON_UNIT' ], + }, + {path : 'fromFacebook/Natalie/GlitchRobot'}, + {path : 'fromFacebook/Ocean/blackvan/blackvan_with_windows'}, + {path : 'fromFacebook/Ocean/zell_van_vertex_color'}, + {path : 'fromFacebook/RAZ/RAZ_ape'}, + {path : 'fromFbxSDK/Box'}, + { + path : 'fromFbxSDK/Humanoid', + ignoredIssues : [ 'UNSUPPORTED_EXTENSION' ], + }, + { + path : 'fromFbxSDK/Camera', + ignoredIssues : [ 'UNSUPPORTED_EXTENSION' ], + }, + {path : 'fromFbxSDK/Normals'}, + {path : 'fromGltfSamples/BoxVertexColors/BoxVertexColors'}, + {path : 'fromGltfSamples/WaterBottle/NewWaterBottle'}, ]; const CONVERSION_TIMEOUT_MS = 50000; describe('FBX2glTF', () => { - const tmpobj = tmp.dirSync(); - for(let model of MODELS) { - const modelName = path.basename(model.path); - describe('Model: ' + modelName, () => { - const fbxPath = path.join('models', model.path + '.fbx'); - let glbBytes; - it('should convert fbx to glb', async () => { - const glbPath = path.join(tmpobj.name, modelName + '.glb'); + const tmpobj = tmp.dirSync(); + for (let model of MODELS) { + const modelName = path.basename(model.path); + describe('Model: ' + modelName, () => { + const fbxPath = path.join('models', model.path + '.fbx'); + let glbBytes; + it('should convert fbx to glb', async () => { + const glbPath = path.join(tmpobj.name, modelName + '.glb'); - try { - const destPath = await fbx2gltf(fbxPath, glbPath, model.args || []); - assert.isNotNull(destPath); - glbBytes = readFileSync(destPath); - } catch (err) { - throw new Error('Conversion failed: ' + err); - } - }).timeout(CONVERSION_TIMEOUT_MS); + try { + const destPath = await fbx2gltf(fbxPath, glbPath, model.args || []); + assert.isNotNull(destPath); + glbBytes = readFileSync(destPath); + } catch (err) { + throw new Error('Conversion failed: ' + err); + } + }).timeout(CONVERSION_TIMEOUT_MS); - it('resulting glb should be valid', async() => { - try { - let options = {}; - if (model.ignoredIssues) { - options.ignoredIssues = model.ignoredIssues; - } - const report = await validateBytes(glbBytes, options); - expect(report.issues.numErrors).to.equal(0); - expect(report.issues.numWarnings).to.equal(0); + it('resulting glb should be valid', async () => { + try { + let options = {}; + if (model.ignoredIssues) { + options.ignoredIssues = model.ignoredIssues; + } + const report = await validateBytes(glbBytes, options); + expect(report.issues.numErrors).to.equal(0); + expect(report.issues.numWarnings).to.equal(0); - } catch (err) { - throw new Error('Validation failed: ' + err); - } - }); - }); - } - console.log('GLB files may be inspected in: ' + tmpobj.name); + } catch (err) { + throw new Error('Validation failed: ' + err); + } + }); + }); + } + console.log('GLB files may be inspected in: ' + tmpobj.name); });