Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the initial file setup for @stlite/desktop on Windows #466

Merged
merged 5 commits into from
Jan 21, 2023

Conversation

whitphx
Copy link
Owner

@whitphx whitphx commented Jan 20, 2023

Resolves #465

@github-actions github-actions bot temporarily deployed to Preview: (fix/desktop-app-windows-path-separator) January 20, 2023 17:20 Inactive
@github-actions github-actions bot temporarily deployed to Preview: (fix/desktop-app-windows-path-separator) January 20, 2023 17:25 Inactive
@whitphx whitphx force-pushed the fix/desktop-app-windows-path-separator branch from 6877836 to bf316af Compare January 20, 2023 17:39
@github-actions github-actions bot temporarily deployed to Preview: (fix/desktop-app-windows-path-separator) January 20, 2023 17:51 Inactive
@github-actions github-actions bot temporarily deployed to Preview: (fix/desktop-app-windows-path-separator) January 20, 2023 17:54 Inactive
@github-actions github-actions bot temporarily deployed to Preview: (fix/desktop-app-windows-path-separator) January 20, 2023 18:10 Inactive
@github-actions github-actions bot temporarily deployed to Preview: (fix/desktop-app-windows-path-separator) January 20, 2023 18:14 Inactive
@github-actions github-actions bot temporarily deployed to Preview: (fix/desktop-app-windows-path-separator) January 20, 2023 18:28 Inactive
@github-actions github-actions bot temporarily deployed to Preview: (fix/desktop-app-windows-path-separator) January 20, 2023 18:32 Inactive
@github-actions github-actions bot temporarily deployed to Preview: (fix/desktop-app-windows-path-separator) January 20, 2023 18:37 Inactive
@github-actions github-actions bot temporarily deployed to Preview: (fix/desktop-app-windows-path-separator) January 20, 2023 18:41 Inactive
@github-actions github-actions bot temporarily deployed to Preview: (fix/desktop-app-windows-path-separator) January 20, 2023 19:05 Inactive
@whitphx
Copy link
Owner Author

whitphx commented Jan 21, 2023

c2dfccd failed the test on Windows as below:

Run yarn test
  yarn test
  shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
yarn run v1.[2](https://github.com/whitphx/stlite/actions/runs/3970187350/jobs/6806089699#step:7:2)2.19
$ craco test
FAIL electron/__tests__/file.test.ts
  walkRead
    × walks in the specified directory, reads the all child file contents, and returns the pairs of the relative path and the file content (25 ms)
    × walks in the specified directory, reads the all child file contents, and returns the pairs of the absolute path and the file content if relative=false (4 ms)

  ● walkRead › walks in the specified directory, reads the all child file contents, and returns the pairs of the relative path and the file content

    expect(received).toEqual(expected) // deep equality

    - Expected  - 1
    + Received  + [3](https://github.com/whitphx/stlite/actions/runs/3970187350/jobs/6806089699#step:7:3)

    @@ -1,7 +1,7 @@
      Object {
    -   "bar/bar.txt": Object {
    +   "bar\\bar.txt": Object {
          "data": Array [
            99,
            111,
            110,
            115,
    @@ -26,10 +26,11 @@
            32,
            101,
            108,
            105,
            116,
    +       13,
            10,
          ],
          "type": "Buffer",
        },
        "foo.txt": Object {
    @@ -58,10 +59,11 @@
            32,
            97,
            109,
            101,
            116,
    +       13,
            10,
          ],
          "type": "Buffer",
        },
      }

       6 |     const targetDirPath = path.resolve(__dirname, "./foo/");
       7 |     const result = await walkRead(targetDirPath);
    >  8 |     expect(result).toEqual({
         |                    ^
       9 |       "foo.txt": Buffer.from("Lorem ipsum dolor sit amet\n"),
      10 |       "bar/bar.txt": Buffer.from("consectetur adipiscing elit\n"),
      11 |     });

      at Object.<anonymous> (electron/__tests__/file.test.ts:8:20)

  ● walkRead › walks in the specified directory, reads the all child file contents, and returns the pairs of the absolute path and the file content if relative=false

    expect(received).toEqual(expected) // deep equality

    - Expected  - 0
    + Received  + 2

    @@ -26,10 +26,11 @@
            32,
            101,
            108,
            105,
            116,
    +       13,
            10,
          ],
          "type": "Buffer",
        },
        "D:\\a\\stlite\\stlite\\packages\\desktop\\electron\\__tests__\\foo\\foo.txt": Object {
    @@ -58,10 +59,11 @@
            32,
            97,
            109,
            101,
            116,
    +       13,
            10,
          ],
          "type": "Buffer",
        },
      }

      15 |     const targetDirPath = path.resolve(__dirname, "./foo/");
      16 |     const result = await walkRead(targetDirPath, false);
    > 17 |     expect(result).toEqual({
         |                    ^
      18 |       [path.resolve(targetDirPath, "./foo.txt")]: Buffer.from(
      19 |         "Lorem ipsum dolor sit amet\n"
      20 |       ),

      at Object.<anonymous> (electron/__tests__/file.test.ts:17:20)

Test Suites: 1 failed, 1 total
Tests:       2 failed, 2 total
Snapshots:   0 total
Time:        [4](https://github.com/whitphx/stlite/actions/runs/3970187350/jobs/6806089699#step:7:5).02[7](https://github.com/whitphx/stlite/actions/runs/3970187350/jobs/6806089699#step:7:8) s
Ran all test suites.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Process completed with exit code 1.

It was solved with 2e8a7f9

@whitphx whitphx marked this pull request as ready for review January 21, 2023 07:11
@whitphx whitphx merged commit 227c797 into main Jan 21, 2023
@whitphx whitphx deleted the fix/desktop-app-windows-path-separator branch January 21, 2023 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't load pages or external assets that were built alongside the script
1 participant