Skip to content

Commit

Permalink
test: 🧪 fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-labs committed Apr 25, 2024
1 parent d931fc4 commit c1fafe6
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/icons/generator/clones/fileClone.ts
Expand Up @@ -7,7 +7,7 @@ import {
FileIconType,
} from './utils/paths';
import { iconFolderPath } from '../constants';
import { cloneIcon } from './utils/svg';
import { cloneIcon, createCloneConfig } from './utils/cloning';
import { writeFileSync } from 'fs';

export function cloneFileIcon(
Expand All @@ -28,7 +28,7 @@ function createFileIconClones(
basePaths: IconPath<FileIconType>[],
hash: string
): IconConfiguration {
const config: IconConfiguration = new IconConfiguration();
const config = createCloneConfig();

basePaths.forEach((base) => {
try {
Expand Down
4 changes: 2 additions & 2 deletions src/icons/generator/clones/folderClone.ts
Expand Up @@ -7,7 +7,7 @@ import {
getFolderIconClonePath,
} from './utils/paths';
import { iconFolderPath } from '../constants';
import { cloneIcon } from './utils/svg';
import { cloneIcon, createCloneConfig } from './utils/cloning';
import { writeFileSync } from 'fs';

export function cloneFolderIcon(
Expand All @@ -28,7 +28,7 @@ function createFolderClones(
basePaths: IconPath<FolderIconType>[],
hash: string
): IconConfiguration {
const config: IconConfiguration = new IconConfiguration();
const config = createCloneConfig();

basePaths.forEach((base) => {
try {
Expand Down
@@ -1,6 +1,6 @@
import { readFileSync } from 'fs';
import { INode, parseSync, stringify } from 'svgson';
import { CustomClone } from '../../../../models';
import { CustomClone, IconConfiguration } from '../../../../models';
import { getColorList, replacementMap } from './color/colors';

export function traverse(node: INode, callback: (node: INode) => void) {
Expand Down Expand Up @@ -91,3 +91,15 @@ export function replaceColors(node: INode, replacements: Map<string, string>) {
}
});
}

export function createCloneConfig() {
const config = new IconConfiguration();
config.light = {
fileExtensions: {},
fileNames: {},
folderNames: {},
folderNamesExpanded: {},
};

return config;
}
2 changes: 1 addition & 1 deletion src/icons/generator/clones/utils/color/colors.ts
@@ -1,5 +1,5 @@
import { INode } from 'svgson';
import { getStyle, traverse } from '../svg';
import { getStyle, traverse } from '../cloning';
import chroma, { valid } from 'chroma-js';
import {
closerMaterialColorTo,
Expand Down
4 changes: 0 additions & 4 deletions src/models/iconConfiguration.ts
Expand Up @@ -27,14 +27,10 @@ export class IconConfiguration {
this.light = {
fileExtensions: {},
fileNames: {},
folderNames: {},
folderNamesExpanded: {},
};
this.highContrast = {
fileExtensions: {},
fileNames: {},
folderNames: {},
folderNamesExpanded: {},
};
this.options = {};
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/runTest.ts
@@ -1,5 +1,5 @@
import { resolve } from 'path';
import { runTests } from 'vscode-test';
import { runTests } from '@vscode/test-electron';

const main = async () => {
try {
Expand Down

0 comments on commit c1fafe6

Please sign in to comment.