-
Notifications
You must be signed in to change notification settings - Fork 21
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
Feature/1.0.0/code coverage #107
Merged
Merged
Conversation
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 doesn't add many tests but it improves the code coverage.
bentonam
pushed a commit
that referenced
this pull request
Feb 16, 2017
* Release/1.0.0/cleanup (#91) * updated linting to use `lint-rules` * General cleanup - Fixed a few linting errors - Updated all main functions to use `function` instead of arrow functions. This improves readability so you can tell the difference between helper functions declared in a main function and global functions. - Updated all functions to be camel case, this also improves readability to tell the difference between functions and everything else. - Updated the way some functions were exported to make the be exported where they were declared instead of at the bottom of the files. - Removed instances of `'use strict';` because babel already adds this in for you automatically - Updated all if statements that have `&&` or `||` to have line breaks between them to improve readability * Added helper libraries, and test settings - `async-array-methods` - `es6-promisify` - ` fs-extra-promisify` - `globby ` * updated `output.js` to use helper libaries * Updated util functions - Replaced `readDirectory` with `findFiles` which is a much faster way to recursively get all the files in a directory - Removed `isDirectory` because it's not being used. - Removed `readFile`, and `makeDirectory` because `fs-extra-promisify` handles these. - Added `readFiles`. This is useful because it also supports `zip` files * reworked `input.js` This update removes several functions that weren't necessary. Also made the code easier to read by reworking the functions by using helper libraries that are doing the redundant part of this file. * reworked `models.js` This update removes several functions that aren't needed and aslo removes the `async` from functions that don't actually need it. It simplifies the overall purpose of the file by using existing helpers, and reworks other functions that were to verbose. * updated `index.js` to return full error instead of just the message. * updated to only import the util that's being used * added `parsers` to utils This update normalizes the way the parsers are used so it doesn't have to be done on a file by file basis. It should reduce the amount of code around converting the functionality of these other parsers significantly * updated `output.js` to export functions correctly * simplified `output.js` * cleaned up `documents.js` * Feature/1.0.0/structure (#99) * added the ability to add documentation This will allow us to document the api to make it easier to know what's avaiable and what's actually going on. * removed Yarn for now This is because yarn doesn't handle binaries correctly, and also doesn't handle things like couchbase which have node-gyp and that have to compile when it's being installed. * Moved the cli to to be under `cli.js` * Renamed `generator.js` to be `index.js` This is so that the main file will be the `index.js` file. This way we can export it and get the same functionality. * added the Logger to the utils This will be the base logger that is used throughout the application * added documentation to the other util functions * added support for ci testing * added unit tests and bug fixes for `utils.js` * syntax update * Feature/1.0.0/main structure (#103) * added the ability to add documentation This will allow us to document the api to make it easier to know what's avaiable and what's actually going on. * removed Yarn for now This is because yarn doesn't handle binaries correctly, and also doesn't handle things like couchbase which have node-gyp and that have to compile when it's being installed. * Moved the cli to to be under `cli.js` * Renamed `generator.js` to be `index.js` This is so that the main file will be the `index.js` file. This way we can export it and get the same functionality. * added the Logger to the utils This will be the base logger that is used throughout the application * added documentation to the other util functions * added support for ci testing * added unit tests and bug fixes for `utils.js` * syntax update * added `base.js` which will be the base for all the classes This will allow you to run each of the functionalities separately without having to depend on each other. It will also allow the logging to be consistent throught the app. * added ability to pass a glob to `utils.findFiles` * updated the way models were parsed This update removed global variables that were being used in those functions, in favor of passing in the model that is being manipulated. Also removes the logic that was being used to resolve dependencies in favor of using `dependency-resolver` that already handles this functionality. This will reduce the amount of testing that we have to do around this file. * added babel-external-helpers * Updated input to be a class * updated models to be a class Also drastically simplified the exisitng code by reworking a few functions and using dependency-resolver to resolve the different dependencies for each model * updated the main fakit function to be a class This main function extends Inputs, Models, and the Base * Updated the cli to only pass valid options. * Updated documents to be a class Also updated to generate documents in documents instead of in models * Updated to return models as an array This update is to remove the need for `this.model_order` by ordering them to begin with. * Cleaned up the cli Also added several todo items to help the various changes that need to take place before the release. * replaced `--format` with `--spacing` * Added the base for the new Output class This also adds tests for validation and options that have been passed. * Added the base functionality to the outputters * Finished folder output Complete with tests * added a pool utility function This is a function that is similar to `map` but it will limit the concurrancy of the functions that're running. * updated archive option to be a filename * added the zip output type complete with tests * general cleanup * removed the need for output document * added the `key` generated document * updated the way the setup function determins the outputter This update is to accomidate the `return` option * update the file generation for the zip test This just updates the location as to where the files get created. * added the base for `Output.output` This also adds test cases for the different types and languages. * added a few prepare tests for output * added the finalize function * added the timeout option that's used for servers * setup the rest of the sync-gateway output * setup the rest of couchbase output * removed `object-path` in favor of lodash `set` and `get` * cleaned up dependencies * fixed bug with the verbose logging option * Updated couchbase output to use `couchbase-promises` Also added test cases for them to ensure it's working correctly * Added a few tests for sync-gateway * remove the Documents class because it's no longer needed * Updated the main fakit class * added nyc code coverage * added the basis for testing the data generation * 🗑removed the `output.js` * Feature/1.0.0/model structure (#104) * made a smarter todo list * Updated models This is complete with tests * added the ability to include input files in the model it's self * Added better error messaging for failed pre/post functions * improved the test utils * added a way to get the users babel config * updated the make file to have documentation * Finished up`parseModelInputs` * Updated model functions to use `|` instead of `>` This is because of issue #84 * Finished up `parseModelFunctions` Babel support now exists * Removed `return` from single line functions Also updated other js standards * Finished up `parseModelReferences` * Finished up `parseModelTypes` * added a json diff checker for testing * Finished up `parseModelDefaults` * Finished up `parseModelCount` * Finished up `filterModelFiles` * Finished up `parseModelDependencies` This update makes data.dependencies an array of urls so you don't have to pass them in anymore * Finished up `resolveDependenciesOrder` * Finished up `registerModels` * Finished up code coverage for models * Feature/1.0.0/data (#105) * Setup base for data tests * Finished up `getPaths` * Finished up `typeToValue` * Finished up Document `init` * Finished up `initializeDocument` * Finished up `buildObject` * Finished up `buildValue` * Finished up `postProcess` * Finished up `transformValueToType` * Moved `postProcessCallback` to be inside `postProcess` There's no reason for this to be a seperate function so it was moved to be inside of the only place it was being used. * Finished up `runData` * Finished up `buildDocument` * Finished up `build` * Removed the testing `utils.string` function Found out it's not needed since you can just pass in the exact string instead * cleanup validation * bugfix for `parseModelCount` * Updated `index.test.js` so only 1-6 documents will get created This required me to use proxyquire to overwrite the document build function so that I could overwrite the functions count and the pre_run functions for each model * Finished up Fakeit.generate * renamed travis file (#106) * Feature/1.0.0/code coverage (#107) * added tests for `Logger.time` and `Logger.timeEnd` * removed unused functions in Logger * added more tests for `Logger.log` * ignore a few parts of the parser tests that are too hard to mock * added more test cases for `objectSearch` * added a test for `findFiles` * improved output/couchbase code coverage * Updated tests for sync-gateway this doesn't add many tests but it improves the code coverage. * improved code coverage for `output/index` * Feature/1.0.0/cli (#110) * bugfix display options count if it exists or the model.count * added the highlight option and csv tables * added the cli complete with tests * bugfix for the way dependencies are set This update ensures that the dependency is always set correctly * Updated the main readme file to be more up to date * Bugfix/1.0.0/arrays (#111) * Updated the max count to be 0 if it wasn't defined already * Removed the parsing of `items.data.count` in `parseModelCount` This has to be handled by the document generation so that all the documents to have arrays that're the same length. * Moved the logic for min and max for items to the documents * Feature/1.0.0/seed (#112) * Added `parseModelSeed` * fixed make coverage command It was building the files every time instead of running the check for source files correctly * added documentation for it in the readme file * added support for seeds during document generation * added support for seed to the cli * Added a note about `faker.date` not working with seeds * updated readme (#113) * Feature/1.0.0/logger (#114) * Moved Logger into it's own file * fixed missed code coverage line for cli * added missed code coverage for logger * updated make codecoverage to fail test if not it's not in the threshold * Check for a typeof number instead of this.optionsoptions * added exit codes to the make test * Bugfix/1.0.0/package json (#116) * added missing dependency of `cli-table` * removed coverage check * Bugfix/1.0.0/babel (#117) * bugfix for babel config Babel config wasn't being found correctly and this fixes the issue. Also added a test case for it. * removed dob from cli test This is because dates won't generate the same thing when using seeds. * added in code coverage check to `make ci` * added `babel-plugin-array-includes` * added `babel-plugin-transform-runtime` * removed es6 instances from test/utils.js * Fixed testing issues with older versions of node * Feature/1.0.0/progress (#118) * added spinner support to help show progression * added spinners to base * updated tests for documents, and index remove pre_run overwrites These files were overwriting models `pre_run` function if it had `this.data.count` referenced to reduce the amount of time it took for unit tests to run for certain models. This is no longer needed because of a simple update to documents * added spinners to models * added spinners to documents * added spinners to cli This update also had to update the output to the console to match the new way of showing documents being generated. * updated index tests to reflect the spinner update * added spinners to output Had to make a few updates around the console because the spinner output should go before the console output so the console outputter only prepares the output for the console and the main output function handles outputting it to the console * fixed typo for cli and spinners * updated documents to handle the spinners better by making it async * Updated social models to output a smaller set of data * updated logger to use format-seconds This way when long processes happen it will display in min and not sec * added a timer for the main generator This way it will display the total number of documents that were created and how long it took. * bugfix for base to turn off spinners if log is false * added `require` to the arguments to pass the model functions * updated cli to parse models better and updated help verbage * added example and updated verbage also added a changelog note about the progress indicator * bugfix for older versions of node * added post to coveralls after successful build (#119) * Feature/1.0.0/examples (#120) * moved model defaults to up ensure they're set * fixed typo in cli * updated install docs to include --save-dev and --global * added better description for `type` complete with examples * relocated `key` to be lower and added a better description with examples * relocated `seed` * updated examples * updated badges to use img.shields.io * Fixed Spacing in Model * Removed username validation from couchbase * Ensured cli arguments are assigned to variables * Updated cli to show help when no models are passed * Updated output tests The output tests have been updated to account for the username not being required when outputting to couchbase * Feature/1.0.0/fork (#121) * updated dependencies * fixed models spinner to be correct * bugfix `parseModelDependencies` Fixes a bug where if two files required the same dependency the second model passed would have it's dependencies removed which causes issues when trying to make the document generation smarter. * updated to exit if lint fails * bugfix for memory leak * added `resolveDependants` This adds an array of model files that are dependent on each model * added `events-async` * Created a `Documents` class that runs the models in a more efficient way * pr fixes * if the model that's passed is `flight-data` make it run serial This is to improve performance on all tests since the flight-data tests are the most cpu intensive. It increases the speed of the tests, and decreases the cpu usage * updated to `events-async@1.1.0` * fixed error with `make lint` on node v4 * pr fixes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.