"use strict";

const path = require('path');
const expect = require('chai').expect
const packageSettings = require('./package.json')

const Up = require('./' + packageSettings.main)


describe('The `main` field in package.json', () => {
  it('points to the entry point of the library', () => {
    expect(Up.parseAndRender('It *actually* worked?')).to.equal('<p>It <em>actually</em> worked?</p>')
  })
})


describe('The `typings` field in package.json', () => {
  it('points to the typings for the entry point of the library', () => {
    const typingsBasename = path.basename(packageSettings.typings, '.d.ts')
    const mainBasename =path.basename(packageSettings.main, '.js')

    expect(typingsBasename).to.equal(mainBasename)
  })
})


describe('The `version` field in package.json', () => {
  it('matches the version of the library', () => {
    expect(packageSettings.version).to.equal(Up.VERSION)
  })
})

@@ -14,20 +14,22 @@
 %0A%0Aconst 
-path
+expect
  = requi
@@ -36,28 +36,32 @@
 re('
-path');
+chai').expect
 %0Aconst 
-expect
+path
  = r
@@ -64,37 +64,32 @@
  = require('
-chai').expect
+path');%0A
 %0Aconst packa
@@ -127,17 +127,16 @@
 .json')%0A
-%0A
 const Up
@@ -181,36 +181,18 @@
 )%0A%0A%0A
-describe('The %60main%60 field i
+context('I
 n pa
@@ -206,36 +206,58 @@
 son', () =%3E %7B%0A  
-it('
+specify('the %60main%60 field 
 points to the en
@@ -399,32 +399,29 @@
 ')%0A  %7D)%0A
-%7D)%0A%0A%0Adescribe('T
+%0A  specify('t
 he %60typi
@@ -435,40 +435,8 @@
 eld 
-in package.json', () =%3E %7B%0A  it('
 poin
@@ -584,20 +584,26 @@
   const 
-ma
+entryPo
 in
+t
 Basename
@@ -604,16 +604,17 @@
 sename =
+ 
 path.bas
@@ -686,20 +686,26 @@
 o.equal(
-ma
+entryPo
 in
+t
 Basename
@@ -715,24 +715,21 @@
  %7D)%0A
-%7D)%0A%0A%0Adescribe('T
+%0A  specify('t
 he %60
@@ -747,40 +747,8 @@
 eld 
-in package.json', () =%3E %7B%0A  it('
 matc

Tidy up package.json tests