Skip to content

Regression: maxDepth silent crash on windows if set to less than 0 #127

Description

@SuperchupuDev

I have no idea what causes this, but 6.4.1 broke tinyglobby tests on windows by throwing that in some tests. I have no idea if users are affected. Looking this issue up shows it might be related to node's test runner though

Seems to be thrown by a test that sets the maxDepth option, once it gets thrown node:test propagates it to all remaining tests

https://github.com/SuperchupuDev/tinyglobby/actions/runs/11371715863/job/31634407668?pr=60

EDIT: also happens outside node:test, instead of throwing an error it..doesn't run? definitely can affect users

repro code:

import path from 'node:path';
import { convertPathToPattern, glob } from 'tinyglobby';

import { createFixture } from 'fs-fixture';

const fixture = await createFixture({
  a: {
    'a.txt': 'a',
    'b.txt': 'b'
  },
  b: {
    'a.txt': 'a',
    'b.txt': 'b'
  },
  '.a/a/a.txt': 'a',
  '.deep/a/a/a.txt': 'a',
  '.symlink': {
    file: ({ symlink }) => symlink('../a/a.txt'),
    dir: ({ symlink }) => symlink('../a')
  }
});

const cwd = fixture.path;

console.log('a', cwd);

const a = await glob({ patterns: ['.deep/a/a/*.txt'], deep: 2, cwd });

console.log('hi', a); // this doesn't ever get logged for some reason

await fixture.rm();

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions