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.

26 lines
1.2 KiB

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