Files
vercel/packages/cli/test/util/get-project-name.test.ts
Nathan Rajlich 465129e62e [cli] Remove support for single file deployments (#6652)
Deploying a single file has printed a deprecation warning for a long time. Let's finally remove that behavior.
2021-12-08 19:45:06 +00:00

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');
});
});