feat: app.getPath('recent') (#23381)
* feat: getPath("recent") * test: Add a spec and docs * fix: Integrate feedback * fix: Handle path change * chore: Cut SetRecentPath
This commit is contained in:
parent
c7b2eb68cf
commit
dcbed18f44
6 changed files with 57 additions and 0 deletions
|
@ -737,6 +737,22 @@ describe('app module', () => {
|
|||
app.setPath('music', __dirname);
|
||||
expect(app.getPath('music')).to.equal(__dirname);
|
||||
});
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
it('gets the folder for recent files', () => {
|
||||
const recent = app.getPath('recent');
|
||||
|
||||
// We expect that one of our test machines have overriden this
|
||||
// to be something crazy, it'll always include the word "Recent"
|
||||
// unless people have been registry-hacking like crazy
|
||||
expect(recent).to.include('Recent');
|
||||
});
|
||||
|
||||
it('can override the recent files path', () => {
|
||||
app.setPath('recent', 'C:\\fake-path');
|
||||
expect(app.getPath('recent')).to.equal('C:\\fake-path');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
describe('setPath(name, path)', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue