-
-
Notifications
You must be signed in to change notification settings - Fork 424
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
438 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
const IS_TEST = process.env.NODE_ENV === 'test' | ||
|
||
module.exports = { | ||
presets: [ | ||
['minimal', { | ||
mode: 'loose' | ||
}] | ||
] | ||
}], | ||
IS_TEST && 'power-assert' | ||
].filter(Boolean) | ||
} |
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 |
---|---|---|
|
@@ -5,12 +5,13 @@ | |
"build:umd": "poi --config build/poi.lib.config.js --prod", | ||
"build:es": "sfc normalize --config build/sfc.config.js", | ||
"build": "npm run build:umd && npm run build:es", | ||
"test": "npm run lint && echo 'no tests!'", | ||
"test": "npm run lint && npm run test:unit", | ||
"lint": "xo", | ||
"website": "poi --serve --config build/poi.website.config.js", | ||
"build:website": "poi --prod --config build/poi.website.config.js", | ||
"prepublishOnly": "npm run build", | ||
"commit": "git-cz" | ||
"commit": "git-cz", | ||
"test:unit": "poi puppet src/**/*.test.js --test --plugin @poi/puppet --framework mocha" | ||
}, | ||
"dependencies": { | ||
"isomorphic-unfetch": "^3.0.0", | ||
|
@@ -29,9 +30,11 @@ | |
"devDependencies": { | ||
"@babel/plugin-syntax-object-rest-spread": "^7.0.0", | ||
"@leptosia/docute-google-analytics": "^1.0.0", | ||
"@poi/plugin-puppet": "^0.1.3", | ||
"@semantic-release/changelog": "^3.0.1", | ||
"@semantic-release/git": "^7.0.5", | ||
"babel-preset-minimal": "^0.1.1", | ||
"babel-preset-power-assert": "^3.0.0", | ||
"bili": "^3.4.2", | ||
"commitizen": "^3.0.5", | ||
"cz-conventional-changelog": "^2.1.0", | ||
|
@@ -43,6 +46,7 @@ | |
"poi": "^12.1.5", | ||
"postcss-import": "^12.0.0", | ||
"postcss-preset-env": "^6.0.3", | ||
"power-assert": "^1.6.1", | ||
"rollup-plugin-vue": "^4.3.2", | ||
"semantic-release": "^15.12.0", | ||
"sfc": "^0.2.13", | ||
|
@@ -57,7 +61,8 @@ | |
"module": "lib/index.js", | ||
"files": [ | ||
"dist", | ||
"lib" | ||
"lib", | ||
"!**/__test__/**" | ||
], | ||
"description": "Effortlessly documentation done right.", | ||
"author": "egoist <[email protected]>", | ||
|
@@ -73,7 +78,8 @@ | |
"**/dist/**" | ||
], | ||
"envs": [ | ||
"browser" | ||
"browser", | ||
"mocha" | ||
], | ||
"globals": [ | ||
"__DOCUTE_VERSION__" | ||
|
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import assert from 'assert' | ||
import {getFilenameByPath} from '..' | ||
|
||
describe('index', () => { | ||
it('getFilenameByPath', () => { | ||
assert(getFilenameByPath(null, '/') === 'README.md') | ||
assert(getFilenameByPath('/', '/') === '/README.md') | ||
assert(getFilenameByPath('./', '/') === 'README.md') | ||
assert(getFilenameByPath('./docs/', '/') === 'docs/README.md') | ||
assert(getFilenameByPath('/docs/', '/') === '/docs/README.md') | ||
assert(getFilenameByPath('/docs/', '/foo') === '/docs/foo.md') | ||
assert(getFilenameByPath('/docs/', '/foo.md') === '/docs/foo.md') | ||
assert(getFilenameByPath('/docs/', '/foo/') === '/docs/foo/README.md') | ||
}) | ||
}) |
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
Oops, something went wrong.