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

StorageMock redundant? #241

Closed
hfwittmann opened this issue Apr 20, 2017 · 3 comments
Closed

StorageMock redundant? #241

hfwittmann opened this issue Apr 20, 2017 · 3 comments

Comments

@hfwittmann
Copy link
Contributor

hfwittmann commented Apr 20, 2017

as far as I can tell the code for StorageMock in src/mock.ts is redundant/not used and should probably be removed. Correct?

export class StorageMock {

  public get(key: string): Promise<{}> {
    return new Promise((resolve: Function) => {
      resolve({});
    });
  }

  public set(key: string, value: string): Promise<{}> {
    return new Promise((resolve: Function) => {
      resolve({key: key, value: value});
    });
  }

  public remove(key: string): Promise<{}> {
    return new Promise((resolve: Function) => {
      resolve({key: key});
    });
  }

  public query(): Promise<{ res: { rows: Array<{}> }}> {
    return new Promise((resolve) => {
      resolve({
        res: {
          rows: [{}]
        }
      });
    });
  }
}
@lathonez
Copy link
Owner

lathonez commented Apr 20, 2017

It's used here: https://github.com/lathonez/clicker/blob/master/src/services/clickers.spec.ts#L10

Query could be removed.

EDIT - sorry, was looking at the wrong file. Yes I think it can be removed.

@lathonez
Copy link
Owner

Thanks a lot!

@hfwittmann
Copy link
Contributor Author

Glad to help. After all, this is the best reference for ionic 2 testing.

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

No branches or pull requests

2 participants