-
Notifications
You must be signed in to change notification settings - Fork 793
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docs): remove deprecated 'docs' type
Use 'docs-readme' instead.
- Loading branch information
1 parent
bfb1271
commit 043e2d8
Showing
4 changed files
with
20 additions
and
40 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 |
---|---|---|
@@ -1,42 +1,35 @@ | ||
import * as d from '@stencil/core/declarations'; | ||
import { mockLogger, mockStencilSystem } from '@stencil/core/testing'; | ||
import { mockConfig } from '@stencil/core/testing'; | ||
import { validateConfig } from '../validate-config'; | ||
|
||
describe('validateDocs', () => { | ||
let config: d.Config; | ||
const logger = mockLogger(); | ||
const sys = mockStencilSystem(); | ||
let userConfig: d.Config; | ||
|
||
beforeEach(() => { | ||
config = { | ||
sys: sys, | ||
logger: logger, | ||
rootDir: '/User/some/path/', | ||
flags: {}, | ||
outputTargets: [{ type: 'www' }], | ||
namespace: 'Testing', | ||
}; | ||
userConfig = mockConfig(); | ||
}); | ||
|
||
it('readme docs dir', () => { | ||
config.flags.docs = true; | ||
config.outputTargets.push({ | ||
type: 'docs', | ||
dir: 'my-dir', | ||
} as d.OutputTargetDocsReadme); | ||
validateConfig(config, [], false); | ||
userConfig.flags.docs = true; | ||
userConfig.outputTargets = [ | ||
{ | ||
type: 'docs-readme', | ||
dir: 'my-dir', | ||
} as d.OutputTargetDocsReadme, | ||
]; | ||
const { config } = validateConfig(userConfig); | ||
const o = config.outputTargets.find(o => o.type === 'docs-readme') as d.OutputTargetDocsReadme; | ||
expect(o.dir).toContain('my-dir'); | ||
}); | ||
|
||
it('default no docs, not remove docs output target', () => { | ||
config.outputTargets.push({ type: 'docs' }); | ||
validateConfig(config, [], false); | ||
userConfig.outputTargets = [{ type: 'docs-readme' }]; | ||
const { config } = validateConfig(userConfig); | ||
expect(config.outputTargets.some(o => o.type === 'docs-readme')).toBe(true); | ||
}); | ||
|
||
it('default no docs, no output target', () => { | ||
validateConfig(config, [], false); | ||
const { config } = validateConfig(userConfig); | ||
expect(config.outputTargets.some(o => o.type === 'docs-readme')).toBe(false); | ||
}); | ||
}); |
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