-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
56 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright (c) 2020, salesforce.com, inc. | ||
* All rights reserved. | ||
* Licensed under the BSD 3-Clause license. | ||
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause | ||
*/ | ||
import * as path from 'path'; | ||
import { TestSession } from '@salesforce/cli-plugins-testkit'; | ||
import { fs } from '@salesforce/core'; | ||
import { expect } from 'chai'; | ||
import { ShadowRepo } from '../../../src/shared/localShadowRepo'; | ||
|
||
describe('verifies behavior of relative pkgDirs', () => { | ||
let session: TestSession; | ||
let repo: ShadowRepo; | ||
|
||
before(async () => { | ||
session = await TestSession.create({ | ||
project: { | ||
sourceDir: path.join('test', 'nuts', 'repros', 'extra-classes'), | ||
}, | ||
authStrategy: 'NONE', | ||
}); | ||
}); | ||
|
||
it('initialize the local tracking', async () => { | ||
repo = await ShadowRepo.getInstance({ | ||
orgId: 'fakeOrgId3', | ||
projectPath: session.project.dir, | ||
packageDirs: [ | ||
{ path: './force-app', name: 'force-app', fullPath: path.join(session.project.dir, './force-app') }, | ||
], | ||
}); | ||
// verify the local tracking files/directories | ||
expect(fs.existsSync(repo.gitDir)); | ||
}); | ||
|
||
it('should not include files from force-app-extra', async () => { | ||
const changedFilenames = await repo.getChangedFilenames(); | ||
expect(changedFilenames).to.be.an('array').with.length.greaterThan(0); | ||
changedFilenames.map((f) => { | ||
expect(f).to.not.contain('force-app-extra'); | ||
}); | ||
}); | ||
|
||
after(async () => { | ||
await session?.clean(); | ||
}); | ||
}); |