Skip to content

Commit

Permalink
Next release with ignorePattern
Browse files Browse the repository at this point in the history
  • Loading branch information
henryruhs committed Jan 10, 2023
1 parent 26cdc5d commit d0893d6
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ specut [options]
-P, --path <path>
-h, --help
```


Documentation
-------------

Read the [documenation](https://henryruhs.gitbook.io/specut) for a deep dive.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "specut",
"description": "Cut massive test suites into equal chunks",
"version": "1.0.0",
"version": "1.1.0",
"license": "MIT",
"type": "module",
"keywords":
Expand All @@ -26,7 +26,7 @@
},
"dependencies":
{
"commander": "9.4.1",
"commander": "9.5.0",
"fast-glob": "3.2.12"
},
"devDependencies":
Expand All @@ -42,7 +42,7 @@
"rollup-plugin-add-shebang": "0.3.1",
"rollup-plugin-copy": "3.4.0",
"rollup-plugin-delete": "2.0.0",
"rollup-plugin-ts": "3.0.2",
"rollup-plugin-ts": "3.1.1",
"ts-node": "10.9.1",
"typescript": "4.9.4"
},
Expand Down
2 changes: 1 addition & 1 deletion src/assets/metadata.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "specut",
"version": "1.0.0"
"version": "1.1.0"
}
1 change: 1 addition & 0 deletions src/assets/option.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"amount": 5,
"mode": "file",
"specPattern": "**/**.spec.{js,jsx,ts,tsx}",
"ignorePattern": "**/node_modules",
"chunkPrefix": "__",
"chunkSuffix": "__",
"path": "."
Expand Down
6 changes: 3 additions & 3 deletions src/core.class.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { EOL } from 'os';
import fs from 'fs';
import glob from 'fast-glob';
import PATH, { dirname, basename } from 'path';
import fg from 'fast-glob';
import { program } from 'commander';
import { Helper } from './helper.class.js';
import { Option } from './option.class.js';
Expand Down Expand Up @@ -50,7 +50,7 @@ export class Core

analyse() : Data
{
const { specPattern, path } : Options = this.option.getAll();
const { specPattern, ignorePattern, path } : Options = this.option.getAll();
const data : Data =
{
files: [],
Expand All @@ -62,7 +62,7 @@ export class Core
}
};

fg.sync(PATH.join(path, specPattern)).map(filePath =>
glob.sync(PATH.join(path, specPattern), { ignore: [ ignorePattern ] }).map(filePath =>
{
const fileContent : string = fs.readFileSync(filePath, 'utf8');

Expand Down
1 change: 1 addition & 0 deletions src/option.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export interface Options
amount : number;
mode : Mode;
specPattern : string;
ignorePattern : string;
chunkPrefix : string,
chunkSuffix : string;
path : string;
Expand Down

0 comments on commit d0893d6

Please sign in to comment.