 errMissingCredentials = 'Missing configuration in env variable named SPHERE_PROJECT_KEY'
 
 argv =
-  projectKey: process.env.SPHERE_PROJECT_KEY
+  projectKey: process.env.SPHERE_PROJECT_KEY || "producttype-json-generator-tests"
   logSilent: true
 
 testProductType = {

      sphereClient = new SphereClient options

  beforeEach ->
    sphereClient.productTypes
    .process (res) ->
      console.log "Deleting old product types", res.body.results.length
      Promise.map res.body.results, (productType) ->
        sphereClient.productTypes.byId(productType.id)
        .delete(productType.version)
      , concurrency: 5
      .then ->
        console.log "Product types were deleted"
      .catch (err) ->
        console.error "There was an error while deleting product types", err

  it 'should import product type', ->
    sphereClient.productTypes.fetch()

  importer = null
  sphereClient = null

  console.log "Using project %s for testing", argv.projectKey
  before ->
    expect(argv.projectKey).to.be.a 'string', errMissingCredentials

