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 error on folder without any md file #14

Merged
merged 1 commit into from
Mar 24, 2020

Conversation

nweldev
Copy link
Contributor

@nweldev nweldev commented Mar 24, 2020

if a directory only has subdirectories, a TypeError (link.children[0] || "").split is not a function was raised

if a directory only has subdirectories, an error was thrown
@ozum ozum merged commit 44f8198 into ozum:master Mar 24, 2020
@ozum
Copy link
Owner

ozum commented Mar 24, 2020

Thanks, I'll update npm in a few minutes.

@ozum
Copy link
Owner

ozum commented Mar 24, 2020

@noelmace, I had to reverse this commit, because it failed a test.

Could you please examine docs/example-missing-readme and related test. It passes when there is no md in folder.

Could you please create a new failing test for your case and create a PR solving it.

Thanks again.

@nweldev
Copy link
Contributor Author

nweldev commented Mar 31, 2020

Hi ozum. If I understand correctly, you're talking about "should throw for missing README.md in Navbar", which was already failing before. I just ran npm run test on 611b4fb just to be sure :
image
Yet, this PR still introduced a regression, as it broke "sort file and folder by prefix" :

getConfig › sort file and folder by prefix

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

    - Expected
    + Received

    @@ -1,16 +1,16 @@
      Object {
        "nav": Array [],
        "sidebar": Array [
          "01-file",
    +     "03-file",
          Object {
            "children": Array [
              "02-folder/file",
            ],
            "title": "Folder",
          },
    -     "03-file",
          Object {
            "children": Array [
              "no-name/last",
            ],
            "title": "No Name",

      30 | 
      31 |   it("sort file and folder by prefix", async () => {
    > 32 |     expect(configOf("sort")).toEqual(expected("sort"));
         |                              ^
      33 |   });
      34 | });
      35 | 

      at Object.<anonymous> (lib/index.test.js:32:30)

My bad 😓 I'm on it!

nweldev pushed a commit to nweldev/vuepress-bar that referenced this pull request Mar 31, 2020
if a directory only has subdirectories, an error was thrown.
fix regression introduced by ozum#14
nweldev pushed a commit to nweldev/vuepress-bar that referenced this pull request Mar 31, 2020
if a directory only has subdirectories, an error was thrown.
fix regression introduced by ozum#14
@nweldev
Copy link
Contributor Author

nweldev commented Mar 31, 2020

done in #16

nweldev pushed a commit to nweldev/vuepress-bar that referenced this pull request Apr 1, 2020
Failing test in order to reproduce the bug ozum#14 was initially trying to
fix: if a directory only has subdirectories, an error is thrown.

Fix ba73ee
see ozum#16 (comment)
nweldev pushed a commit to nweldev/vuepress-bar that referenced this pull request Apr 1, 2020
if a directory only has subdirectories, an error was thrown.
fix regression introduced by ozum#14
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.

3 participants