ObjToSchematic/tests/random-dither.test.ts
2023-03-01 18:06:13 +00:00

24 lines
802 B
TypeScript

import fs from 'fs';
import { StatusHandler, StatusID } from '../src/status';
import { AppPaths, PathUtil } from '../src/util/path_util';
import { WorkerClient } from '../src/worker_client';
import { headlessConfig } from '../tools/headless-config';
import { TEST_PREAMBLE } from './preamble';
test('Random-dither', () => {
TEST_PREAMBLE();
const config = headlessConfig;
config.import.fileSource = fs.readFileSync(PathUtil.join(AppPaths.Get.resources, './samples/skull.obj'), 'utf-8');
config.assign.dithering = 'random';
const worker = WorkerClient.Get;
worker.import(headlessConfig.import);
worker.voxelise(headlessConfig.voxelise);
worker.assign(headlessConfig.assign);
expect(StatusHandler.Get.hasId(StatusID.SchematicUnsupportedBlocks)).toBe(false);
});