web 3d图形渲染器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
1.2 KiB

  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const assert = require("assert");
  4. const path = require("path");
  5. const fs_macchiato_1 = require("../../fs.macchiato");
  6. const fs = require("./adapters/fs");
  7. const settings_1 = require("./settings");
  8. describe('Settings', () => {
  9. it('should return instance with default values', () => {
  10. const settings = new settings_1.default();
  11. assert.deepStrictEqual(settings.fs, fs.createFileSystemAdapter());
  12. assert.ok(!settings.followSymbolicLinks);
  13. assert.ok(!settings.stats);
  14. assert.strictEqual(settings.pathSegmentSeparator, path.sep);
  15. assert.ok(settings.fsStatSettings);
  16. assert.ok(settings.throwErrorOnBrokenSymbolicLink);
  17. });
  18. it('should return instance with custom values', () => {
  19. const lstatSync = () => new fs_macchiato_1.Stats();
  20. const settings = new settings_1.default({
  21. fs: fs.createFileSystemAdapter({ lstatSync }),
  22. stats: true
  23. });
  24. assert.deepStrictEqual(settings.fs, fs.createFileSystemAdapter({ lstatSync }));
  25. assert.ok(settings.stats);
  26. });
  27. });