tswaters / atom-mocha-runner

atom mocha test runner.
https://atom.io/packages/mocha-runner
MIT License
4 stars 0 forks source link

Uncaught Error: must provide pattern #5

Closed prometheas closed 9 years ago

prometheas commented 9 years ago

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.0.7 System: Mac OS X 10.10.5 Thrown From: mocha-runner package, v1.1.5

Stack Trace

Uncaught Error: must provide pattern

At /Users/lianoglj/.atom/packages/mocha-runner/lib/runner.js:47

Error: must provide pattern
    at new Glob (/Users/lianoglj/.atom/packages/mocha-runner/node_modules/mocha/node_modules/glob/glob.js:120:11)
    at glob (/Users/lianoglj/.atom/packages/mocha-runner/node_modules/mocha/node_modules/glob/glob.js:57:11)
    at Function.globSync (/Users/lianoglj/.atom/packages/mocha-runner/node_modules/mocha/node_modules/glob/glob.js:76:10)
    at Object.lookupFiles (/Users/lianoglj/.atom/packages/mocha-runner/node_modules/mocha/lib/utils.js:590:20)
    at /Users/lianoglj/.atom/packages/mocha-runner/lib/worker/index.js:77:37
    at Array.forEach (native)
    at process.<anonymous> (/Users/lianoglj/.atom/packages/mocha-runner/lib/worker/index.js:76:19)
    at emitTwo (events.js:87:13)
    at process.emit (events.js:169:7)
    at handleMessage (child_process.js:306:10)

Commands

     -1:32.8.0 command-palette:toggle (atom-text-editor.editor.is-focused)
  3x -1:30.8.0 core:move-down (atom-text-editor.editor.mini.is-focused)
  2x -1:26.2.0 core:move-up (atom-text-editor.editor.mini.is-focused)
     -1:14.9.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -1:14.9.0 mocha-test-runner:debug (atom-text-editor.editor)
     -1:08.1.0 command-palette:toggle (atom-text-editor.editor.is-focused)
     -1:06.7.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -1:06.7.0 mocha-test-runner:run (atom-text-editor.editor)
     -0:57.5.0 settings-view:open (atom-text-editor.editor.is-focused)
     -0:25.5.0 editor:move-to-first-character-of-line (atom-text-editor#mocha-runner.test-directory.editor.mini.is-focused)
     -0:24.2.0 core:save (atom-text-editor#mocha-runner.test-directory.editor.mini.is-focused)
     -0:21.2.0 core:close (atom-text-editor#mocha-runner.test-directory.editor.mini.is-focused)
     -0:17.1.0 command-palette:toggle (atom-text-editor.editor.is-focused)
     -0:08.7.0 core:move-down (atom-text-editor.editor.mini.is-focused)
     -0:07.9.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -0:07.9.0 mocha-runner:run-specs (atom-text-editor.editor)

Config

{
  "core": {
    "themes": [
      "nucleus-dark-ui",
      "seti-syntax"
    ],
    "disabledPackages": [
      "debugger",
      "wrap-guide",
      "Clean2",
      "json-schema",
      "mocha",
      "wakatime"
    ]
  },
  "mocha-runner": {
    "test-directory": "./tests"
  }
}

Installed Packages

# User
Sublime-Style-Column-Selection, v1.3.0
aligner-css, v1.2.0
aligner-php, v1.0.0
api-docs, v0.0.3
atom-chai-snippets, v0.3.0
atom-macros, v0.5.1
atom-phpcs, v0.8.0
atom-ternjs, v0.7.2
autocomplete-php, v0.3.7
caniuse, v0.5.5
clipboard-plus, v0.5.1
docblockr, v0.7.3
editorconfig, v1.1.1
external-open, v0.6.1
file-icons, v1.6.9
flex-tool-bar, v0.5.0
foldingtext-for-atom, v0.9.0
formatter, v2.12.3
git-tab-status, v1.9.2
imdone-atom, v1.1.32
jsformat, v0.9.0
language-apache, v1.3.0
language-diff, v0.3.1
language-fish-shell, v1.0.2
language-gherkin, v1.0.2
line-ending-converter, v1.3.2
linter, v1.4.3
linter-csslint, v1.0.5
linter-jshint, v1.1.5
linter-php, v1.0.3
linter-phpcs, v1.0.6
linter-scss-lint, v2.0.0
make-executable, v0.1.1
minimap, v4.13.1
minimap-bookmarks, v0.1.0
minimap-git-diff, v4.1.8
minimap-linter, v1.0.0
mocha-runner, v1.1.5
mocha-test-runner, v0.4.4
nucleus-dark-ui, v0.1.10
package-manager-commands, v2.0.3
php-composer-completion, v0.3.4
php-introspector, v1.0.0
phpunit, v1.1.1
pigments, v0.11.0
project-manager, v1.15.11
set-syntax, v0.3.0
seti-syntax, v0.4.0
travis-ci-status, v0.16.0
vagrant, v0.1.0

# Dev
No dev packages

It's saying I need a mocha.opts file, but honestly I don't think its absence should make the module vomit like this, instead using sensible defaults.

tswaters commented 9 years ago

There's no way to identify what to run the tests against with the absence of project-level package settings.

Actually, running mocha without a mocha.opts loads test/*.{js,coffee}.... I suppose the plugin could do that.

tswaters commented 9 years ago

This is fixed, available in 1.1.6

prometheas commented 9 years ago

Nice one :)