Closed tomaszs closed 4 years ago
@tomaszs Yes same questions from me. I have created my config and specified framework: karma, however I am getting jest.fn references in the spec.ts output file.
Found a solution, you can use parameter on command line:
ngentest auth.service.ts -s --framework=karma
@minux84 yes, it works.
You also can use config file https://github.com/allenhwkim/ngentest#config
if config file does not work for karma, please let me know the detail with example. I am not using Karma, preferring Jest, so I need error detail or full repo. example.
@allenhwkim I think it's more about the documentation. Where the file should go, what should be format to that file, and if it needs to be declared in any place.
@allenhwkim I don't think the config file is working as we are expecting it to. The documentation says
You can override configuration by creating a file named as ngentest.config.js in your application directory.
which leaves me to believe that I should be able to add the file to the root of my project and run ngentest from there; however, ngentest is actually looking for the config file in the root of the directory it is installed in.
const appRoot = require('app-root-path');
if (fs.existsSync(path.join(appRoot.path, 'ngentest.config.js'))) {
Making changes to the config file there appears to work. I think this logic should be changed to allow the user to specify the config file to use as an argument (maybe --config
), check the working directory if --config
is not set, and maybe use the one in ngentest's root directory as a backup. Let me know what you think; I have some free time so I can help work on this issue.
@jacobmcgowan plz make a PR for it
Hello,
I have some questions: