mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-09 12:57:46 +00:00
Deploying a single file has printed a deprecation warning for a long time. Let's finally remove that behavior.
30 lines
662 B
TypeScript
30 lines
662 B
TypeScript
import getProjectName from '../../src/util/get-project-name';
|
|
|
|
describe('getProjectName', () => {
|
|
it('should work with argv', () => {
|
|
const project = getProjectName({
|
|
argv: {
|
|
'--name': 'abc',
|
|
},
|
|
});
|
|
expect(project).toEqual('abc');
|
|
});
|
|
|
|
it('should work with `vercel.json` config', () => {
|
|
const project = getProjectName({
|
|
argv: {},
|
|
nowConfig: { name: 'abc' },
|
|
});
|
|
expect(project).toEqual('abc');
|
|
});
|
|
|
|
it('should work with a directory', () => {
|
|
const project = getProjectName({
|
|
argv: {},
|
|
nowConfig: {},
|
|
paths: ['/tmp/aa'],
|
|
});
|
|
expect(project).toEqual('aa');
|
|
});
|
|
});
|