HEX
Server: Apache
System: Linux webd004.cluster130.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User: frenchy (106757)
PHP: 7.4.33
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/f/r/e/frenchy/www/french-american.org/current/node_modules/@allmarkedup/fang/test/index.js
'use strict';

const Path = require("path");
const expect = require("chai").expect;
const fang = require("../.");

describe("fang", function(){

    it("returns language information about a file with a known extension", function(){
        const lang = fang('assets/main.scss');
        expect(lang).to.be.an('object');
        expect(lang).to.have.property('name');
        expect(lang).to.have.property('mode');
        expect(lang).to.have.property('scope');
        expect(lang).to.have.property('color');
    });

    it("returns undefined if the extension is not recognised", function(){
        const lang = fang('assets/main.XFXFXF');
        expect(lang).to.be.undefined;
    });

    it("returns undefined when a directory path is used", function(){
        const lang = fang('assets/css');
        expect(lang).to.be.undefined;
    });


});