ページ

2010-12-26

Express と Expresso を使う際の注意点

12/26 現在 npm でリリースされている Express 1.0.0 と Expresso 0.7.0 を使う際の注意点です。

1つ目

コマンドラインで自動生成されるテストコードにバグがあります。

Express では、
$ mkdir foo
$ express foo
で、プロジェクトを自動生成できます。 /test に app.test.js というテストコードがあります。これは Expresso 用のテストコードですが、いまの Expresso では動きません。そこでテストコードを以下のように修正します。

修正その1

※ ちなみに このエクステンション を使うと gist の diff がとれます。便利すぎるのでおすすめです。

これでルートディレクトリから
$ expresso
を実行すると、テストが走ります。Github のコードは修正されているので、もうしばらく待っていたら解消すると思います。



2つ目

Expresso では -c でカバレッジを取ることができますが、 /lib 配下のコードにしか対応していません。そこで /lib をつくって app.js を移動します。

$ mkdir lib
$ mv app.js lib
外部ファイルのパスを修正します。


テストコードのパスも修正します。

修正その3

テストは expresso の引数でライブラリのパスを指定して実行します。

$ expresso -I lib -c

これでカバレッジも取れるようになりました。

最終的なソースコードはこうなっています。


以上、 Express と Expresso を使う際のちょっとした注意点でした。

Happy Noding!


4 件のコメント:

  1. Flipkart is Offering Cashback Offers Flipkart AXIS Cashback Offer You will get upto 75% Discount

    Flipkart is Offering Cashback Offers Flipkart YES Cashback Offer You will get upto 75% Discount

    Flipkart is Offering Cashback Offers Flipkart Phonepe Cashback Offer You will get upto 75% Discount

    Flipkart is Offering Cashback Offers Flipkart Cashback Offer You will get upto 75% Discount

    Flipkart is one of the biggest world wide eCommerce Site flipkart cashback offersso

    Flipkart is one of the biggest world wide eCommerce Site Flipkart hdfc offersso

    返信削除
  2. flipkart is Offering Cashback Offers Flipkart hdfc cashback offers You will get upto 75% Discount

    Flipkart is Offering Cashback Offers Flipkart SBI Cashback Offer You will get upto 75% Discount

    Flipkart is Offering Cashback Offers Flipkart AXIS Cashback Offer You will get upto 75% Discount

    Flipkart is Offering Cashback Offers Flipkart YES Cashback Offer You will get upto 75% Discount

    Flipkart is one of the biggest world wide eCommerce Site so here you will getFlipkart big billion day offers

    Flipkart is one of the biggest world wide eCommerce Site so here you will getflipkart bank cashback offersso


    Flipkart cashback offers on mobiles,
    Flipkart cashback offers,
    Flipkart cashback coupons,
    Flipkart upcoming offers on mobiles,
    Flipkart HDFC cashback offers,
    Flipkart SBI cashback offers,
    Flipkart AXIS cashback offers,
    Flipkart Citibank cashback offers,
    Flipkart cashback on mobiles,
    Flipkart cashback offers today,
    Flipkart big billion day cashback offers,
    Flipkart big billion days cashback offers,
    big billion day cashback offers,
    Flipkart big billion days offers,
    flipkart cashback on mobiles,
    flipkart citibank offer,
    sbi credit card offers on flipkart today,
    flipkart upcoming offers on mobiles,
    hdfc credit card offers on flipkart,
    flipkart upcoming big billion day,
    flipkart upcoming sale,
    sbi credit card offers on mobiles,
    flipkart offers today,
    flipkart offers on mobiles,
    flipkart offers today mobile phones,
    flipkart cashback offers,
    flipkart cashback coupons,
    flipkart sale today offer,
    flipkart cashback offers today,
    cashback offers,
    flipkart cashback offer today

    返信削除
  3. nice post.super article .iam follow your website.


    Flipkart CashBack Offers-SBI, HDFC, ICICI, Citibank Cards&Flipkart HDFC Cards Offers"
    flipkart bank offers,flipkart cash back coupons,flipkart offers 2018,flipkart coupons 2018,flipkart cashback offers 2018,flipkart cashback offers,flipkart cash back offers,flipkart cashback coupons,flipkart cashback,Flipkart Cashback Offers,Flipkart Bank Offers,Flipkart Deals 2018, flipkart upcoming offers on mobiles, hdfc credit card offers on flipkart 2018 flipkart sbi offer big billion day, flipkart hdfc offer, flipkart hdfc offer august 2018 sbi flipkart offer 2018 flipkart icici offer


    FLIPKART CITIBANK OFFER,FLIPKART ICICI OFFER,
    SBI CARD OFFERS ON FLIPKART,
    FLIPKART CASHBACK OFFER TODAY,FLIPKART CREDIT CARD OFFERS,
    ALL BANK CREDIT CARD OFFERS,HDFC CREDIT CARD OFFERS ON FLIPKART,
    AXIS BANK CREDIT CARD OFFERS ON FLIPKART,
    CITIBANK CREDIT CARD OFFERS ON FLIPKART,SBI FLIPKART OFFER



    Flipkart Cashback Offers||Flipkart Bank Offers||Flipkart Deals 2018||flipkart upcoming offers,"
    "Flipkart Cashback Offers || Flipkart Bank Offers || Flipkart Deals 2018 ||" "flipkart upcoming offers on mobiles, hdfc credit card offers on flipkart 2018, sbi credit card offers on flipkart today, flipkart hdfc offer terms and conditions, sbi flipkart offer 2018, flipkart cashback phonepe, flipkart hdfc offer august 2018, flipkart icici offer

    flipkart is Offering Cashback Offers Flipkart hdfc cashback offers You will get upto 75% Discount

    Flipkart is Offering Cashback Offers Flipkart SBI Cashback Offer You will get upto 75% Discount

    Flipkart is Offering Cashback Offers Flipkart AXIS Cashback Offer You will get upto 75% Discount

    Flipkart is Offering Cashback Offers Flipkart YES Cashback Offer You will get upto 75% Discount

    Flipkart is one of the biggest world wide eCommerce Site so here you will getFlipkart big billion day offers

    Flipkart is one of the biggest world wide eCommerce Site so here you will getflipkart bank cashback offersso


    Flipkart cashback offers on mobiles,
    Flipkart cashback offers,
    Flipkart cashback coupons,
    Flipkart upcoming offers on mobiles,
    Flipkart HDFC cashback offers,
    Flipkart SBI cashback offers,
    Flipkart AXIS cashback offers,
    Flipkart Citibank cashback offers,
    Flipkart cashback on mobiles,
    Flipkart cashback offers today,
    Flipkart big billion day cashback offers,
    Flipkart big billion days cashback offers,
    big billion day cashback offers,
    Flipkart big billion days offers,
    flipkart cashback on mobiles,
    flipkart citibank offer,
    sbi credit card offers on flipkart today,
    flipkart upcoming offers on mobiles,
    hdfc credit card offers on flipkart,
    flipkart upcoming big billion day,
    flipkart upcoming sale,
    sbi credit card offers on mobiles,
    flipkart offers today,
    flipkart offers on mobiles,
    flipkart offers today mobile phones,
    flipkart cashback offers,
    flipkart cashback coupons,
    flipkart sale today offer,
    flipkart cashback offers today,
    cashback offers,
    flipkart cashback offer today

    返信削除

  • HOME
  • ABOUT
このページの先頭へ