Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
chore: run format, modify tests a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
martinalbert committed Feb 2, 2021
1 parent 5fb7cf3 commit 3835a38
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/commands/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ export default class Create extends Command {

// compose document structure from the result
const documentStructure = documentResult.value;
const { scope, middle: [name, provider], version } = documentStructure;
const {
scope,
middle: [name, provider],
version,
} = documentStructure;

if (version === undefined) {
throw developerError('version must be present', 1);
Expand Down
15 changes: 11 additions & 4 deletions src/commands/init.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ import { stdout } from 'stdout-stderr';

import { EXTENSIONS } from '../common/document';
import { access, rimraf } from '../common/io';
import { BUILD_DIR, GRID_DIR, META_FILE, SUPERFACE_DIR, TYPES_DIR } from '../logic/init';
import {
BUILD_DIR,
GRID_DIR,
META_FILE,
SUPERFACE_DIR,
TYPES_DIR,
} from '../logic/init';
import Init from './init';

describe('Init CLI command', () => {
Expand Down Expand Up @@ -32,8 +38,7 @@ describe('Init CLI command', () => {
const expectedDirectories = [SUPERFACE_DIR, BUILD_DIR, TYPES_DIR, GRID_DIR];

expect(stdout.output).toContain(
`$ mkdir 'fixtures/playgrounds/test'
$ echo '<.npmrc template>' > 'fixtures/playgrounds/test/.npmrc'
`$ echo '<.npmrc template>' > 'fixtures/playgrounds/test/.npmrc'
$ mkdir 'fixtures/playgrounds/test/superface'
$ echo '<super.json template>' > 'fixtures/playgrounds/test/superface/super.json'
$ echo '<.gitignore template>' > 'fixtures/playgrounds/test/superface/.gitignore'
Expand Down Expand Up @@ -71,7 +76,9 @@ $ mkdir 'fixtures/playgrounds/test/superface/build'

const expectedDirectories = [SUPERFACE_DIR, BUILD_DIR, TYPES_DIR, GRID_DIR];

expect(stdout.output).not.toContain("$ mkdir 'fixtures/playgrounds/test");
expect(stdout.output).not.toContain(
"$ mkdir 'fixtures/playgrounds/test/superface"
);

await expect(
Promise.all(
Expand Down

0 comments on commit 3835a38

Please sign in to comment.