mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-30 09:34:23 +01:00
style: fix lint issues in src/config.spec.ts
It looks like our linter automatically converts `let` to `const` in TypeScript files, but not in JavaScript files.
This commit is contained in:
@@ -6,16 +6,16 @@ describe('when working with site config', function () {
|
||||
configApi.setSiteConfig({});
|
||||
});
|
||||
it('should set site config and config properly', function () {
|
||||
let config_0 = { foo: 'bar', bar: 0 };
|
||||
const config_0 = { foo: 'bar', bar: 0 };
|
||||
configApi.setSiteConfig(config_0);
|
||||
let config_1 = configApi.getSiteConfig();
|
||||
let config_2 = configApi.getConfig();
|
||||
const config_1 = configApi.getSiteConfig();
|
||||
const config_2 = configApi.getConfig();
|
||||
expect(config_1.foo).toEqual(config_0.foo);
|
||||
expect(config_1.bar).toEqual(config_0.bar);
|
||||
expect(config_1).toEqual(config_2);
|
||||
});
|
||||
it('should respect secure keys when applying directives', function () {
|
||||
let config_0 = {
|
||||
const config_0 = {
|
||||
foo: 'bar',
|
||||
bar: 'cant-be-changed',
|
||||
secure: [...configApi.defaultConfig.secure, 'bar'],
|
||||
@@ -27,30 +27,30 @@ describe('when working with site config', function () {
|
||||
expect(cfg.bar).toBe(config_0.bar);
|
||||
});
|
||||
it('should set reset config properly', function () {
|
||||
let config_0 = { foo: 'bar', bar: 0 };
|
||||
const config_0 = { foo: 'bar', bar: 0 };
|
||||
configApi.setSiteConfig(config_0);
|
||||
let config_1 = { foo: 'baf' };
|
||||
const config_1 = { foo: 'baf' };
|
||||
configApi.setConfig(config_1);
|
||||
let config_2 = configApi.getConfig();
|
||||
const config_2 = configApi.getConfig();
|
||||
expect(config_2.foo).toEqual(config_1.foo);
|
||||
configApi.reset();
|
||||
let config_3 = configApi.getConfig();
|
||||
const config_3 = configApi.getConfig();
|
||||
expect(config_3.foo).toEqual(config_0.foo);
|
||||
let config_4 = configApi.getSiteConfig();
|
||||
const config_4 = configApi.getSiteConfig();
|
||||
expect(config_4.foo).toEqual(config_0.foo);
|
||||
});
|
||||
it('should set global reset config properly', function () {
|
||||
let config_0 = { foo: 'bar', bar: 0 };
|
||||
const config_0 = { foo: 'bar', bar: 0 };
|
||||
configApi.setSiteConfig(config_0);
|
||||
let config_1 = configApi.getSiteConfig();
|
||||
const config_1 = configApi.getSiteConfig();
|
||||
expect(config_1.foo).toEqual(config_0.foo);
|
||||
let config_2 = configApi.getConfig();
|
||||
const config_2 = configApi.getConfig();
|
||||
expect(config_2.foo).toEqual(config_0.foo);
|
||||
configApi.setConfig({ foobar: 'bar0' });
|
||||
let config_3 = configApi.getConfig();
|
||||
const config_3 = configApi.getConfig();
|
||||
expect(config_3.foobar).toEqual('bar0');
|
||||
configApi.reset();
|
||||
let config_4 = configApi.getConfig();
|
||||
const config_4 = configApi.getConfig();
|
||||
expect(config_4.foobar).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user