mirror of
https://gitlab.com/nightlycommit/twing.git
synced 2025-01-18 08:46:50 +02:00
Resolve issue #615
This commit is contained in:
parent
ec4a05cbbc
commit
2e48d48966
8
.gitignore
vendored
8
.gitignore
vendored
@ -1,9 +1,3 @@
|
|||||||
.nyc_output
|
|
||||||
dist
|
dist
|
||||||
coverage
|
|
||||||
docs/.bundle
|
|
||||||
docs/_site
|
|
||||||
docs/vendor
|
|
||||||
node_modules
|
node_modules
|
||||||
package-lock.json
|
package-lock.json
|
||||||
tmp
|
|
@ -29,7 +29,7 @@
|
|||||||
"html"
|
"html"
|
||||||
],
|
],
|
||||||
"include": [
|
"include": [
|
||||||
"**/src/**"
|
"**/main/**"
|
||||||
],
|
],
|
||||||
"exclude": []
|
"exclude": []
|
||||||
}
|
}
|
@ -39,22 +39,22 @@ npm run test:browser
|
|||||||
|
|
||||||
### Writing and executing tests
|
### Writing and executing tests
|
||||||
|
|
||||||
Assuming one want to execute the test located in `test/tests/integration/comparison/to-array.ts`, one would run:
|
Assuming one want to execute the test located in `src/test/tests/integration/comparison/to-array.ts`, one would run:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
ts-node test/tests/integration/comparison/to-array.ts
|
ts-node src/test/tests/integration/comparison/to-array.ts
|
||||||
```
|
```
|
||||||
|
|
||||||
It is even possible - and recommended - to track the coverage while writing tests:
|
It is even possible - and recommended - to track the coverage while writing tests:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
nyc ts-node test/tests/integration/comparison/to-array.ts
|
nyc ts-node src/test/tests/integration/comparison/to-array.ts
|
||||||
```
|
```
|
||||||
|
|
||||||
Of course, it is also perfectly possible to pipe the result of the test to your favorite tap formatter:
|
Of course, it is also perfectly possible to pipe the result of the test to your favorite tap formatter:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
test/tests/integration/comparison$ ts-node . | tap-nyan
|
src/test/tests/integration/comparison$ ts-node . | tap-nyan
|
||||||
9 -_-_-_-_-_,------,
|
9 -_-_-_-_-_,------,
|
||||||
0 -_-_-_-_-_| /\_/\
|
0 -_-_-_-_-_| /\_/\
|
||||||
0 -_-_-_-_-^|__( ^ .^)
|
0 -_-_-_-_-^|__( ^ .^)
|
||||||
|
@ -34,9 +34,9 @@
|
|||||||
"test": "node dist/test",
|
"test": "node dist/test",
|
||||||
"test:browser": "browserify dist/test/index.js | tape-run --sandbox=false",
|
"test:browser": "browserify dist/test/index.js | tape-run --sandbox=false",
|
||||||
"build": "npm run build:cjs && npm run build:types && npm run bundle",
|
"build": "npm run build:cjs && npm run build:types && npm run bundle",
|
||||||
"build:cjs": "rimraf dist/cjs && tsc --project . --module commonjs --outDir dist/cjs",
|
"build:cjs": "rimraf dist/cjs && tsc --project src/main --module commonjs --outDir dist/cjs",
|
||||||
"build:test": "rimraf dist && tsc --project test --outDir dist",
|
"build:test": "rimraf dist && tsc --project src/test --outDir dist",
|
||||||
"build:types": "rimraf dist/types && tsc --project . --declaration true --emitDeclarationOnly true --outDir dist/types",
|
"build:types": "rimraf dist/types && tsc --project src/main --declaration true --emitDeclarationOnly true --outDir dist/types",
|
||||||
"bundle": "browserify dist/cjs/lib.js -g uglifyify -s Twing -o dist/lib.min.js"
|
"bundle": "browserify dist/cjs/lib.js -g uglifyify -s Twing -o dist/lib.min.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -265,7 +265,7 @@ export {createWithTagHandler} from "./lib/tag-handler/with";
|
|||||||
export type {
|
export type {
|
||||||
TwingCallable, TwingCallableArgument, TwingCallableWrapperOptions, TwingCallableWrapper
|
TwingCallable, TwingCallableArgument, TwingCallableWrapperOptions, TwingCallableWrapper
|
||||||
} from "./lib/callable-wrapper";
|
} from "./lib/callable-wrapper";
|
||||||
export type {TwingContext} from "./lib/context";
|
export {type TwingContext, createContext} from "./lib/context";
|
||||||
export type {TwingEnvironment, TwingEnvironmentOptions, TwingNumberFormat} from "./lib/environment";
|
export type {TwingEnvironment, TwingEnvironmentOptions, TwingNumberFormat} from "./lib/environment";
|
||||||
export type {
|
export type {
|
||||||
TwingEscapingStrategy, TwingEscapingStrategyHandler, TwingEscapingStrategyResolver
|
TwingEscapingStrategy, TwingEscapingStrategyHandler, TwingEscapingStrategyResolver
|
||||||
@ -280,7 +280,7 @@ export type {TwingNodeVisitor} from "./lib/node-visitor";
|
|||||||
export type {
|
export type {
|
||||||
TwingOperator, TwingOperatorAssociativity, TwingOperatorType, TwingOperatorExpressionFactory
|
TwingOperator, TwingOperatorAssociativity, TwingOperatorType, TwingOperatorExpressionFactory
|
||||||
} from "./lib/operator";
|
} from "./lib/operator";
|
||||||
export type {TwingOutputBuffer} from "./lib/output-buffer";
|
export {type TwingOutputBuffer, createOutputBuffer} from "./lib/output-buffer";
|
||||||
export type {TwingParser, TwingParserOptions} from "./lib/parser";
|
export type {TwingParser, TwingParserOptions} from "./lib/parser";
|
||||||
export type {TwingSandboxSecurityPolicy} from "./lib/sandbox/security-policy";
|
export type {TwingSandboxSecurityPolicy} from "./lib/sandbox/security-policy";
|
||||||
export type {TwingSource} from "./lib/source";
|
export type {TwingSource} from "./lib/source";
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user