~ubuntu-branches/ubuntu/vivid/node-mime/vivid

« back to all changes in this revision

Viewing changes to test.js

  • Committer: Package Import Robot
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2013-09-16 11:50:41 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20130916115041-tzh1rw8295k2cdtr
Tags: 1.2.11-1
* New upstream release, modify patch to apply clean.
* Add myself to uploaders.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
// Test mime lookups
19
19
//
20
20
 
21
 
eq('text/plain', mime.lookup('text.txt'));
22
 
eq('text/plain', mime.lookup('.text.txt'));
23
 
eq('text/plain', mime.lookup('.txt'));
24
 
eq('text/plain', mime.lookup('txt'));
25
 
eq('application/octet-stream', mime.lookup('text.nope'));
26
 
eq('fallback', mime.lookup('text.fallback', 'fallback'));
27
 
eq('application/octet-stream', mime.lookup('constructor'));
28
 
eq('text/plain', mime.lookup('TEXT.TXT'));
29
 
eq('text/event-stream', mime.lookup('text/event-stream'));
30
 
eq('application/x-web-app-manifest+json', mime.lookup('text.webapp'));
 
21
eq('text/plain', mime.lookup('text.txt'));     // normal file
 
22
eq('text/plain', mime.lookup('TEXT.TXT'));     // uppercase
 
23
eq('text/plain', mime.lookup('dir/text.txt')); // dir + file
 
24
eq('text/plain', mime.lookup('.text.txt'));    // hidden file
 
25
eq('text/plain', mime.lookup('.txt'));         // nameless
 
26
eq('text/plain', mime.lookup('txt'));          // extension-only
 
27
eq('text/plain', mime.lookup('/txt'));         // extension-less ()
 
28
eq('text/plain', mime.lookup('\\txt'));        // Windows, extension-less
 
29
eq('application/octet-stream', mime.lookup('text.nope')); // unrecognized
 
30
eq('fallback', mime.lookup('text.fallback', 'fallback')); // alternate default
31
31
 
32
32
//
33
33
// Test extensions
43
43
eq('html', mime.extension('text/html ; charset=UTF-8'));
44
44
eq('html', mime.extension('text/html;charset=UTF-8'));
45
45
eq('html', mime.extension('text/Html;charset=UTF-8'));
46
 
eq(undefined, mime.extension('constructor'));
 
46
eq(undefined, mime.extension('unrecognized'));
47
47
 
48
48
//
49
 
// Test node types
 
49
// Test node.types lookups
50
50
//
51
51
 
52
52
eq('application/font-woff', mime.lookup('file.woff'));