Help us understand the problem. What is going on with this article?

Jasmineのテスト内で画像を表示する

More than 5 years have passed since last update.

「public」フォルダに画像ファイルを置く。

describe "Sample Image", ->
  sampleImage = undefined
  beforeEach ->
    sampleImage = new Image
    sampleImage.src = "public/sample11.jpg"

  it "should be defined", ->
    $(sampleImage).appendTo('body')
    expect(sampleImage).toBeDefined()

これでテストページの末尾に画像が表示される


ブログやってます:PAPA-tronix !

Feel-Physics
今はHoloLensのアプリを開発しており、技術記事はすべてブログ( http://weed.nagoya )に書いています。以前はSwift、OpenCV+Python、JavaScript、Objective-Cを書いていました。
http://feel-physics.jp
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away