Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(test): migrate to vitest #235

Merged
merged 38 commits into from
Jan 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
5a8ea48
chore(test): rename folder to legacy
Shinigami92 Jan 19, 2022
1482e61
chore(deps): add vitest dependency
Shinigami92 Jan 19, 2022
ec515ec
chore(test): convert time
Shinigami92 Jan 19, 2022
3f8f8fb
chore: add test script
Shinigami92 Jan 19, 2022
e6c8196
chore: test against lib
Shinigami92 Jan 19, 2022
d067fa1
chore: migrate unique
Shinigami92 Jan 19, 2022
96b925c
chore: migrate word
Shinigami92 Jan 19, 2022
7c9b0c3
chore(test): migrate music
Shinigami92 Jan 19, 2022
e837da9
chore(test): migrate locales
Shinigami92 Jan 19, 2022
ee44fee
chore(test): migrate animal
Shinigami92 Jan 19, 2022
a53456c
chore(test): migrate all.functional
Shinigami92 Jan 20, 2022
d93bdb1
chore(test): migrate address
Shinigami92 Jan 20, 2022
daf5e76
chore(test): migrate commerce
Shinigami92 Jan 20, 2022
bb969e2
chore(test): migrate company
Shinigami92 Jan 20, 2022
bef063c
chore(test): migrate database
Shinigami92 Jan 20, 2022
2aee729
chore(test): migrate datatype
Shinigami92 Jan 20, 2022
e05ab05
chore(test): migrate date
Shinigami92 Jan 20, 2022
de9414f
chore(test): migrate fake
Shinigami92 Jan 20, 2022
d924b16
chore(test): migrate finance iban
Shinigami92 Jan 20, 2022
3dcbe9f
chore(test): migrate git
Shinigami92 Jan 20, 2022
e793e04
chore(test): migrate finance
Shinigami92 Jan 20, 2022
a287d65
chore(test): migrate helpers
Shinigami92 Jan 20, 2022
732af6b
chore(test): migrate image
Shinigami92 Jan 20, 2022
c4da571
chore(test): migrate internet
Shinigami92 Jan 20, 2022
0596909
chore(test): migrate lorem
Shinigami92 Jan 20, 2022
184e0cd
chore(test): migrate name
Shinigami92 Jan 20, 2022
027dbf4
chore(test): improve types
Shinigami92 Jan 20, 2022
cb07a67
chore(test): migrate phone_number
Shinigami92 Jan 20, 2022
e4859da
chore(test): migrate random
Shinigami92 Jan 20, 2022
1eeabbd
chore(test): migrate system
Shinigami92 Jan 20, 2022
b7fc373
chore(test): migrate vehicle
Shinigami92 Jan 20, 2022
4a962ae
chore(test): migrate luhnCheck
Shinigami92 Jan 20, 2022
d2b2609
chore(test): remove legacy tests
Shinigami92 Jan 20, 2022
7b13e15
chore: remove legacy test dependencies
Shinigami92 Jan 20, 2022
a148b05
chore: cleanup
Shinigami92 Jan 20, 2022
ba56bd0
chore: fix typo
Shinigami92 Jan 20, 2022
d7e7935
chore: use type import
Shinigami92 Jan 20, 2022
c528cb5
chore: update readme
Shinigami92 Jan 20, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"env": {
"browser": true,
"jquery": true,
"mocha": true,
"node": true
},
"globals": {},
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ library. There are still a lot of things to be done, so all contributions are we

- The project is being built by [gulp](http://gulpjs.com/) (see [gulpfile](build/gulpfile.js)), destination directory is [build/build](build/build)
- The documentation is auto-generated, based on [build/src](build/src) markdown sources. If you modify the main [Readme.md](Readme.md) file, the Pull Request will be rejected, since it will be overwritten by the upcoming `gulp` execution
- The tests are executing `mocha` against all js contents of [test](test) directory
- The tests are executing `vitest` against `test/**/*.spec.ts`

## Architecture

Expand Down
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -467,37 +467,43 @@ Faker uses [gulp](http://gulpjs.com/) to automate its build process. Each build
### Browser Bundle

```shell
npm run browser
pnpm install
pnpm run build
pnpm run browser
```

### Testing

```shell
npm install
npm run test
pnpm install
pnpm run build

pnpm run test
# or
pnpm run coverage
```

You can view a code coverage report generated in coverage/lcov-report/index.html.
You can view a code coverage report generated in `coverage/index.html`.

### Developing the docs

```shell
# build the Faker library for the browser
# it's used inside of certain routes
npm run browser
pnpm run browser

npm run docs:dev
pnpm run docs:dev
```

### Building and serving the docs statically

```shell
# build the Faker library for the browser
# it's used inside of certain routes
npm run browser
pnpm run browser

npm run docs:build # Output docs to /dist
npm run docs:serve # Serve docs from /dist
pnpm run docs:build # Output docs to /dist
pnpm run docs:serve # Serve docs from /dist
```

### Deploying Documentation
Expand Down
40 changes: 7 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@
"preinstall": "npx only-allow pnpm",
"build": "tsc",
"browser": "gulp browser",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"docs:build": "vitepress build docs",
"docs:build:ci": "run-s build browser docs:build",
"docs:dev": "vitepress dev docs",
"docs:serve": "vitepress serve docs",
"format": "prettier --write .",
"lint": "echo 'TODO eslint'",
"test": "mocha test/*.*.js"
"test": "vitest",
"coverage": "vitest --coverage"
},
"simple-git-hooks": {
"pre-commit": "npx lint-staged --concurrent false",
Expand All @@ -59,35 +59,11 @@
"eslint --ext .js,.ts"
]
},
"nyc": {
"all": false,
"exclude": [
"coverage",
"locales",
"modules",
"white",
"docs",
"docker",
"public",
"reports",
"tests",
"node_modules"
],
"include": [
"lib/**/*.js",
"vendor/*.js"
],
"report-dir": "./reports/coverage",
"reporter": [
"html",
"lcov",
"clover"
]
},
"devDependencies": {
"@vitest/ui": "~0.1.24",
"browserify": "^16.5.2",
"c8": "~7.11.0",
"conventional-changelog-cli": "~2.2.2",
"coveralls": "^3.1.0",
"eslint": "^6.5.1",
"esno": "~0.13.0",
"gulp": "^4.0.2",
Expand All @@ -96,21 +72,19 @@
"gulp-uglify": "^3.0.2",
"ink-docstrap": "1.1.4",
"lint-staged": "~9.5.0",
"lodash": "^4.6.1",
"mocha": "^8.1.1",
"npm-run-all": "~4.1.5",
"nyc": "^15.1.0",
"optimist": "0.3.5",
"picocolors": "~1.0.0",
"prettier": "2.5.1",
"simple-git-hooks": "~2.7.0",
"sinon": "^9.0.3",
"through2": "2.0.0",
"typescript": "~4.5.4",
"vinyl-buffer": "^1.0.1",
"vinyl-source-stream": "^2.0.0",
"vinyl-transform": "^1.0.0",
"vitepress": "^0.21.4"
"vite": "~2.7.13",
"vitepress": "^0.21.4",
"vitest": "~0.1.24"
},
"packageManager": "pnpm@6.26.1",
"engines": {
Expand Down
Loading