Skip to content

Commit

Permalink
test: ut for forceignore injection
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Aug 2, 2024
1 parent 78ba78c commit 1ff3f66
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/resolve/forceIgnore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,21 @@ describe('ForceIgnore', () => {

afterEach(() => env.restore());

describe('contents injections', () => {
const newContents = 'force-app/main/default/classes/';
it('Should accept an override for the contents of the forceignore file', () => {
const forceIgnore = new ForceIgnore('', newContents);
expect(forceIgnore.accepts(join('force-app', 'main', 'default', 'classes', 'foo'))).to.be.false;
});
it('injected contents prevent reading the forceignore file', () => {
const readStub = env.stub(fs, 'readFileSync');
const forceIgnore = new ForceIgnore(forceIgnorePath, newContents);
expect(readStub.called).to.be.false;
expect(forceIgnore.accepts(join(forceIgnorePath, 'force-app', 'main', 'default', 'classes', 'foo'))).to.be.false;
expect(forceIgnore.accepts(testPath)).to.be.true;
});
});

it('Should default to not ignoring a file if forceignore is not loaded', () => {
const path = join('some', 'path');
const forceIgnore = new ForceIgnore();
Expand Down

2 comments on commit 1ff3f66

@svc-cli-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 1ff3f66 Previous: 0f149cc Ratio
eda-componentSetCreate-linux 190 ms 181 ms 1.05
eda-sourceToMdapi-linux 2224 ms 2270 ms 0.98
eda-sourceToZip-linux 1816 ms 1800 ms 1.01
eda-mdapiToSource-linux 2808 ms 2962 ms 0.95
lotsOfClasses-componentSetCreate-linux 362 ms 368 ms 0.98
lotsOfClasses-sourceToMdapi-linux 3587 ms 3640 ms 0.99
lotsOfClasses-sourceToZip-linux 2988 ms 3042 ms 0.98
lotsOfClasses-mdapiToSource-linux 3536 ms 3511 ms 1.01
lotsOfClassesOneDir-componentSetCreate-linux 633 ms 625 ms 1.01
lotsOfClassesOneDir-sourceToMdapi-linux 6392 ms 6347 ms 1.01
lotsOfClassesOneDir-sourceToZip-linux 5426 ms 5438 ms 1.00
lotsOfClassesOneDir-mdapiToSource-linux 6403 ms 6292 ms 1.02

This comment was automatically generated by workflow using github-action-benchmark.

@svc-cli-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 1ff3f66 Previous: 0f149cc Ratio
eda-componentSetCreate-win32 404 ms 379 ms 1.07
eda-sourceToMdapi-win32 4297 ms 4082 ms 1.05
eda-sourceToZip-win32 2780 ms 2731 ms 1.02
eda-mdapiToSource-win32 6146 ms 5740 ms 1.07
lotsOfClasses-componentSetCreate-win32 919 ms 832 ms 1.10
lotsOfClasses-sourceToMdapi-win32 7777 ms 7629 ms 1.02
lotsOfClasses-sourceToZip-win32 5019 ms 4865 ms 1.03
lotsOfClasses-mdapiToSource-win32 8008 ms 7595 ms 1.05
lotsOfClassesOneDir-componentSetCreate-win32 1589 ms 1495 ms 1.06
lotsOfClassesOneDir-sourceToMdapi-win32 14037 ms 13563 ms 1.03
lotsOfClassesOneDir-sourceToZip-win32 8276 ms 8660 ms 0.96
lotsOfClassesOneDir-mdapiToSource-win32 13217 ms 13862 ms 0.95

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.