diff --git a/docs/WritingSpecs.md b/docs/WritingSpecs.md index a1f158e96..9d2312be5 100644 --- a/docs/WritingSpecs.md +++ b/docs/WritingSpecs.md @@ -5,17 +5,15 @@ Section: Guides Order: 7 --- -# Writing specs - Nylas uses [Jasmine](http://jasmine.github.io/1.3/introduction.html) as its spec framework. As a package developer, you can write specs using Jasmine 1.3 and get some quick wins. Jasmine specs can be run in N1 directly from the Developer menu, and the test environment provides you with helpful stubs. You can also require your own test framework, or use Jasmine for integration tests and your own framework for your existing business logic. This documentation describes using [Jasmine 1.3](http://jasmine.github.io/1.3/introduction.html) to write specs for a Nylas package. -#### Running Specs +### Running Specs You can run your package specs from `Developer > Run Package Specs...`. Once you've opened the spec window, you can see output and re-run your specs by clicking `Reload Specs`. -#### Writing Specs +### Writing Specs To create specs, place `js`, `coffee`, or `cjsx` files in the `spec` directory of your package. Spec files must end with the `-spec` suffix. diff --git a/internal_packages/onboarding/spec/nylas-api-environment-store-spec.coffee b/internal_packages/onboarding/spec/nylas-api-environment-store-spec.coffee index c6da261b6..fbbec1c6f 100644 --- a/internal_packages/onboarding/spec/nylas-api-environment-store-spec.coffee +++ b/internal_packages/onboarding/spec/nylas-api-environment-store-spec.coffee @@ -15,18 +15,18 @@ describe "NylasApiEnvironmentStore", -> spyOn(atom, "inDevMode").andReturn true spyOn(atom.config, "get").andReturn undefined store = new storeConstructor() - expect(atom.config.set).toHaveBeenCalledWith("env", "staging") + expect(atom.config.set).toHaveBeenCalledWith("env", "production") it "initializes with the correct default in production", -> spyOn(atom, "inDevMode").andReturn false spyOn(atom.config, "get").andReturn undefined store = new storeConstructor() - expect(atom.config.set).toHaveBeenCalledWith("env", "staging") + expect(atom.config.set).toHaveBeenCalledWith("env", "production") describe "when setting the environment", -> it "sets from the desired action", -> - Actions.changeAPIEnvironment("production") - expect(atom.config.set).toHaveBeenCalledWith("env", "production") + Actions.changeAPIEnvironment("staging") + expect(atom.config.set).toHaveBeenCalledWith("env", "staging") it "throws if the env is invalid", -> expect( -> Actions.changeAPIEnvironment("bad")).toThrow()