LoginSignup
0
0

More than 3 years have passed since last update.

Mochaで実行時に特定のテストをスキップする

Posted at

こんな感じで this.skip() を使えばOK。

const assert = require('assert');
const os = require('os');

suite('テスト', function(){
    test('Winの場合はスキップ', function(){
        if (os.platform() == 'win32') this.skip();
        assert.ok(1);
    });
});

this が必要なので、アロー関数内のテストだとダメ。関数で囲うべし。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0