11'use strict' ;
22
3- const QUnit = require ( 'qunit' ) ;
3+ const assert = require ( 'chai' ) . assert ;
44const fs = require ( 'fs-extra' ) ;
55const path = require ( 'path' ) ;
66const updateDemoUrl = require ( '../../../lib/utils/update-demo-url' ) ;
77
8- const qModule = QUnit . module ;
9- const test = QUnit . test ;
10-
11- qModule ( '`updateDemoUrl` | fixture test' , hooks => {
8+ describe ( '`updateDemoUrl` | fixture test' , function ( ) {
129 const fixturesPath = path . join ( __dirname , '../..' , 'fixtures' , 'update-demo-url' ) ;
1310
1411 let inputCopyPath , outputPath , setupFixtureDirectory ;
1512
16- hooks . beforeEach ( ( ) => {
13+ beforeEach ( function ( ) {
1714 setupFixtureDirectory = ( dir ) => {
1815 inputCopyPath = path . join ( fixturesPath , dir , 'input--temp.json' ) ;
1916 outputPath = path . join ( fixturesPath , dir , 'output.json' ) ;
2017 fs . copySync ( path . join ( fixturesPath , dir , 'input.json' ) , inputCopyPath ) ;
2118 }
2219 } ) ;
2320
24- hooks . afterEach ( ( ) => {
21+ afterEach ( function ( ) {
2522 if ( inputCopyPath ) {
2623 fs . unlinkSync ( inputCopyPath ) ;
2724 inputCopyPath = '' ;
2825 }
2926 } ) ;
3027
31- test ( 'it leaves the `homepage` property if it already exists' , assert => {
28+ it ( 'it leaves the `homepage` property if it already exists' , function ( ) {
3229 setupFixtureDirectory ( 'has-existing-homepage' ) ;
3330
3431 const result = updateDemoUrl ( inputCopyPath ) ;
@@ -40,7 +37,7 @@ qModule('`updateDemoUrl` | fixture test', hooks => {
4037 ) ;
4138 } ) ;
4239
43- test ( 'it adds the `homepage` property based on git remote repository' , assert => {
40+ it ( 'it adds the `homepage` property based on git remote repository' , function ( ) {
4441 const dir = 'has-git-repository' ;
4542 setupFixtureDirectory ( dir ) ;
4643
@@ -55,7 +52,7 @@ qModule('`updateDemoUrl` | fixture test', hooks => {
5552 ) ;
5653 } ) ;
5754
58- test ( 'it adds the `homepage` property based on package repository value' , assert => {
55+ it ( 'it adds the `homepage` property based on package repository value' , function ( ) {
5956 setupFixtureDirectory ( 'has-package-repository' ) ;
6057
6158 const result = updateDemoUrl ( inputCopyPath ) ;
@@ -67,7 +64,7 @@ qModule('`updateDemoUrl` | fixture test', hooks => {
6764 ) ;
6865 } ) ;
6966
70- test ( 'it adds the `homepage` property based on package repository url property' , assert => {
67+ it ( 'it adds the `homepage` property based on package repository url property' , function ( ) {
7168 setupFixtureDirectory ( 'has-git-repository-object' ) ;
7269
7370 const result = updateDemoUrl ( inputCopyPath ) ;
@@ -79,7 +76,7 @@ qModule('`updateDemoUrl` | fixture test', hooks => {
7976 ) ;
8077 } ) ;
8178
82- test ( 'it returns false when there is no repository to update' , assert => {
79+ it ( 'it returns false when there is no repository to update' , function ( ) {
8380 const dir = 'missing-repository' ;
8481 setupFixtureDirectory ( dir ) ;
8582
@@ -89,7 +86,7 @@ qModule('`updateDemoUrl` | fixture test', hooks => {
8986 assert . notOk ( result ) ;
9087 } ) ;
9188
92- test ( 'it returns false when the repository is not a git repo' , assert => {
89+ it ( 'it returns false when the repository is not a git repo' , function ( ) {
9390 const dir = 'non-git-repository' ;
9491 setupFixtureDirectory ( dir ) ;
9592
0 commit comments