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

unwanted console.log[s] in integration tests output #54

Open
davidecavaliere opened this issue Sep 4, 2019 · 2 comments
Open

unwanted console.log[s] in integration tests output #54

davidecavaliere opened this issue Sep 4, 2019 · 2 comments

Comments

@davidecavaliere
Copy link
Contributor

davidecavaliere commented Sep 4, 2019

Running the following test:


describe('DynamodbService', () => {
  let instance: UserPersistenceService;

  beforeEach(() => {
    instance = new UserPersistenceService();
    dynamodb.install();
    dynamodb.start({
      port: 8000
    });
  });

  it('can be instantiated', () => {

    expect(instance instanceof UserPersistenceService).toBeTruthy();
  });


  afterEach(() => {
    dynamodb.stop({
      port: 8000
    })
  });
});

produces the following output in tests results:

 PASS  packages/datagator/src/lib/dynamodb/dynamodb.service.spec.ts (6.001s)
  ● Console

    console.log node_modules/dynamodb-localhost/dynamodb/installer.js:12
      Started downloading dynamodb-local from http://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz into /home/developer/src/microgamma/node_modules/dynamodb-localhost/dynamodb/bin. Process may take few minutes.
    console.log node_modules/dynamodb-localhost/index.js:30
      Dynamodb Local Started, Visit: http://localhost:8000/shell

I expect the output to be clean and to still be able to get debugging info if wanted using DEBUG=dynamodb-localhost:* environment variable

@hntrl
Copy link

hntrl commented Nov 1, 2019

I'll do you one better. I get 7000+ lines of nothing from using the install handler.

@codan84
Copy link

codan84 commented Aug 23, 2021

+1.
Any logging to the console should be an option! Can we please be able to switch that one off?
For now I run install in a child_process.fork with silent: true (https://nodejs.org/docs/latest/api/child_process.html#child_process_child_process_fork_modulepath_args_options).
Unfortunately due to how stopping of the DB works we can't do the same with start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants