Polyman Documentation - v3.1.0
    Preparing search index...

    Function testFileIndex

    • Index of a test file name: N for test<N>.txt where N is a positive integer, otherwise null. This is the one rule for "is this a test file", so stray files such as test1.txt.bak, test_notes.txt or test0.txt are never treated as tests.

      Parameters

      • file: string

        File name (not a path)

      Returns number | null

      The test index, or null if the name is not a test

      testFileIndex('test12.txt'); // 12
      testFileIndex('test1.txt.bak'); // null