Code Monkey home page Code Monkey logo

Comments (4)

stephenplusplus avatar stephenplusplus commented on September 26, 2024 3

I don't anticipate having an official solution for this. For offline development, you can use any HTTP request interceptor library that may exist. You can see the endpoints we hit in the source code, and if you want to log all of them:

const Storage = require('@google-cloud/storage')
const gcs = new Storage()

gcs.interceptors.push({
  request: reqOpts => {
    console.log(reqOpts)
    return reqOpts
  }
})

This will log all HTTP requests we make in the format the request module accepts.

Also, if you pass customEndpoint: true, it will skip the authentication step:

const Storage = require('@google-cloud/storage')
const gcs = new Storage({ customEndpoint: true })

Hopefully this is helpful. Feel free to ask any questions.

from nodejs-storage.

lukesneeringer avatar lukesneeringer commented on September 26, 2024 1

From @nfarina on February 13, 2017 18:40

I found that it was simple enough to create my own mock classes to emulate Google Cloud Storage just enough for my tests to pass. I posted my code to this gist in case anyone finds it useful as a starting point. Note: written in ES7 with Flow annotations.

from nodejs-storage.

lukesneeringer avatar lukesneeringer commented on September 26, 2024

From @stephenplusplus on October 20, 2016 19:52

Can you link the mock libraries? I'm not sure they'd be the same, but soon we will support using a custom endpoint which accepts the requests from our API (#1630).

from nodejs-storage.

lukesneeringer avatar lukesneeringer commented on September 26, 2024

From @arbesfeld on October 20, 2016 19:54

Here are a few :

from nodejs-storage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.