@@ -62,25 +62,41 @@ describe("Patch", function() {
6262
6363 } ) ;
6464
65- it ( "can generate patch from blobs" , async function ( ) {
66- // Generates a patch for README.md from commit fce88902e66c72b5b93e75bdb5ae717038b221f6
65+ it ( "can generate patch from blobs" , function ( ) {
66+ // Generates a patch for README.md from commit
67+ // fce88902e66c72b5b93e75bdb5ae717038b221f6
6768 const file = "README.md" ;
6869
69- const blob = await NodeGit . Blob . lookup ( this . repository , "b252f396b17661462372f78b7bcfc403b8731aaa" ) ;
70- const oldBlob = await NodeGit . Blob . lookup ( this . repository , "b8d014998072c3f9e4b7eba8486011e80d8de98a" ) ;
71- const patch = await NodeGit . Patch . fromBlobs ( oldBlob , file , blob , file ) ;
72-
73- assert . strictEqual ( patch . size ( 0 , 0 , 0 ) , 254 ) ;
70+ NodeGit . Blob . lookup (
71+ this . repository ,
72+ "b252f396b17661462372f78b7bcfc403b8731aaa"
73+ ) . then ( blob => {
74+ NodeGit . Blob . lookup (
75+ this . repository ,
76+ "b8d014998072c3f9e4b7eba8486011e80d8de98a"
77+ ) . then ( oldBlob => {
78+ NodeGit . Patch . fromBlobs ( oldBlob , file , blob , file )
79+ . then ( patch => {
80+ assert . strictEqual ( patch . size ( 0 , 0 , 0 ) , 254 ) ;
81+ } ) ;
82+ } ) ;
83+ } ) ;
7484 } ) ;
7585
76- it ( "can generate patch from blobs without 'old_blob'" , async function ( ) {
77- // Generates a patch for README.md from commit fce88902e66c72b5b93e75bdb5ae717038b221f6
78- // without old_blob. Should show all lines as additions.
86+ it ( "can generate patch from blobs without 'old_blob'" , function ( ) {
87+ // Generates a patch for README.md from commit
88+ // fce88902e66c72b5b93e75bdb5ae717038b221f6 without
89+ // old_blob. Should show all lines as additions.
7990 const file = "README.md" ;
8091
81- const blob = await NodeGit . Blob . lookup ( this . repository , "b252f396b17661462372f78b7bcfc403b8731aaa" ) ;
82- const patch = await NodeGit . Patch . fromBlobs ( null , file , blob , file ) ;
83-
84- assert . strictEqual ( patch . size ( 0 , 0 , 0 ) , 8905 ) ;
92+ NodeGit . Blob . lookup (
93+ this . repository ,
94+ "b252f396b17661462372f78b7bcfc403b8731aaa"
95+ ) . then ( blob => {
96+ NodeGit . Patch . fromBlobs ( null , file , blob , file )
97+ . then ( patch => {
98+ assert . strictEqual ( patch . size ( 0 , 0 , 0 ) , 8905 ) ;
99+ } ) ;
100+ } ) ;
85101 } ) ;
86102} ) ;
0 commit comments