Skip to content

Commit

Permalink
test: fix build env for e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
danielleroux committed Sep 10, 2024
1 parent c702587 commit 04a819a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ icons/
/playwright/.cache/
/svg
/components
/e2e/sample.json
src/components/icon/svg/*.svg
2 changes: 1 addition & 1 deletion e2e/all-icon.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { ConsoleMessage, expect, test } from '@playwright/test';
import * as iconsFile from './../dist/sample.json';
import * as iconsFile from './sample.json';
import * as icons from './../icons';

function convertToCamelCase(value: string) {
Expand Down
25 changes: 1 addition & 24 deletions scripts/build-icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,7 @@ async function buildIcons() {
version,
),

writeIconSampleJson(iconCollection, path.join(rootPath, 'build-dist'), version),
writeGlobalCSSFile(path.join(rootPath, 'build-dist', 'css', 'ix-icons.css')),
writeIconSampleJson(iconCollection, path.join(rootPath, 'e2e'), version),
fs.writeFile(
iconsPkgPath,
JSON.stringify(
Expand Down Expand Up @@ -250,26 +249,4 @@ function getDataUrl(svgData: string) {
return `"data:image/svg+xml;utf8,${svg}"`;
}

async function writeGlobalCSSFile(targetPath: string) {
// Write the global css file to keep the application compiling after update to 2.0.0
fs.ensureDirSync(path.join(targetPath, '..'));

return fs.writeFile(
targetPath,
`
/*
* SPDX-FileCopyrightText: 2023 Siemens AG
*
* SPDX-License-Identifier: MIT
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/*
* Deprecated since 2.0.0 no global css file is necessary.
*/
`,
);
}

buildIcons();

0 comments on commit 04a819a

Please sign in to comment.